How to Fix a Door That Swings Shut
When a door is hung square and plumb, its hinges are aligned and the door will stay in place when partially or fully opened. If the hinges are out of alignment for any reason, the law of gravity dictates that the door will fall open or closed, swinging on its hinges to reach its lowest point.
Correcting the problem requires a small investment of time and a few common household tools.
Open the door and check that the hinge pins are seated all the way within the hinge. If not, align the hinge knuckles and tap the pins into place with a hammer.
Use a screwdriver to tighten the screws attaching the hinges to the door and the door frame. Turn them clockwise with moderate pressure. Check to see if the door still falls shut.
Remove the hinge pins if the door still won't stay open. Latch the door and have a helper steady it while you work. Begin with the bottom pin and work up. Angle the blade of a large flathead screwdriver against the tip of the hinge pin and tap the base of the screwdriver to push the pins upward and out. Open the door slightly and slip it off the hinges.
Remove the screws securing the bottom hinge leaf to the door frame and take off the hinge leaf. Use it as a pattern to cut a shim---a spacer---from a piece of poster board or a thin sheet of cardboard or plastic. Place the shim against the door frame (beneath the hinge leaf) and screw the hinge back into place.
Lift the door back up onto the hinges with the aid of a helper. Starting at the top, tap the hinge pins back into place with the hammer. Test the door. If it still swings shut, add another shim.