Ghost doors, self closing or self opening doors are a fairly common problem in homes and sometimes offices. They are caused by the door jamb being out of plumb one way or the other. It may be that the house has shifted over time or perhaps the door was installed incorrectly in the first place.
Check it with a level if you like…You will find that the jamb with the hinges on it is leaning a bit, either in the direction of one room or the other or, within the opening, towards or away from the latch side jamb. This causes the door to swing open or closed by itself.
There are two ways to fix this problem:
1. The hard way: Remove the door casing (decorative trim around door). Remove the door jamb by cutting the nails behind jamb with reciprocating saw or hacksaw blade. Reinstall jamb and door so that it is plumb and level in both directions, then reinstall casing. This will stop the door from swinging open or closed by itself.
2. The easy way: Remove one of the hinge pins. I usually start with the bottom hinge. Tap the pin upward out of the hinge using a hammer and a pin punch. If you don’t have a pin punch an eight penny nail will work. Another option is to try to separate the top flat part of the pin from the hinge by tapping a flat head screwdriver between those two parts. This usually works but be careful not to mar the hinge or surface of the door.
Lay the pin down on a hard surface, concrete works best for me. Prop up top or bottom of pin with a thin piece of wood. Strike the pin at about the center of the length firmly with a hammer. The goal is to bend the pin a little, maybe 1/8″ or so off of the straight line that it was. After that, align the two parts of the hinge and tap the pin back in with a hammer. It will be a little harder to push in because of the bend but be firm with it and it will go in.
Check the action of the door. You should find that the door stays put now. If it still wants to swing a little, repeat the same procedure on the remaining hinge or hinges. This has solved this problem quite well for me over the years.
It would probably be helpful to have another person to help hold the door in position when you have one of the pins out and then to help align the two parts of the hinge when you reinsert the pin.