How to stop wall climbing

Whenever my character jumps and collides with a wall he gets stuck and then can climb higher. I don’t want the player to be able to do this. Any advice on how to prevent this?

Screenshot: http://imgur.com/AIqT44o

That’s a pretty common bug in games, but I don’t know how to fix it.

.