All these cocks need is a damned good fright by everyone who has dealings with them. They will settle down after the summer anyway but, in the meantime they have to be firmly persuaded that they are in danger of a hiding if they attack anyone.
The best way is to enter the pen with a broom or brush, or a short-handled plastic shovel, or some other object. Even a stout cardboard box will do. When the cock comes at you, you must set about him with the object and keep at him till he breaks off from his attacks, drops his tail, and retreats. Then give him another dunt, making him scoot away from you, just to get the point across.
He will still serve his hens, leave fertile eggs, crow, eat drink and look good, but he will not take you on after that. Everyone who has anything to do in the hen run must treat him the same. Children can accomplish this too if aided by an adult. The object of the exercise is to persuade the cock that he has been beaten by an adversary. A cock with his tail up is onthe make; if he drops his tail he is beat.
I went to see a cock at a friend's place recently. He was raking everyone, kids included, and had drawn blood. I grabbed a cardboard box and severely buffeted him with it. He struck it about half a dozen times, but I kept at him, belting him as he came forward, and bringing it down upon him as I got the chance. He broke off and was beat. The owner still didn't want to keep him, so I took him home for some cross hens of mine. He keeps way from me now.