I posted a thread recently about something similar. DS was head banging. I don't know how to link to the thread sorry.

I totally ignored it (except in dangerous situations like banging on the glass door) and thankfully, he just grew out of that stage. Took a month or so.

HTH
Spring