T.Y.
My nephew did this when he was angry or upset. He did grow out of it. You should probably call your doctor to let him/her know what's going on. They will probably tell you it's a phase but it doesn't hurt. It might help just to hear it from them. When you say ignoring it didn't work, what do you mean? Were you unable to ignore it or you did ignore it and it didn't work? The reason I ask is that you really need to minimize it and step out of the room if you can (as long as he is safe). If they know that it's bothering you at all, it's getting attention. I would very calmly tell him it is unacceptable behavior and that you will talk to him when he is ready...then walk away and don't look back (at least when he can see you). Of course, you always want to make sure he can't hurt himself but my nephew never did...he'd bang his head, and after awhile he'd stop. My son did it for awhile too but not as much as my nephew. I can imagine it is very difficult to ignore but I'm sure he'll grow out of it. For your sake, I hope it's soon.