To unlock the free Pirate Hat, type in: SOMBRERO on the Club Penguin Unlock Items page.
Congratulations! You just unlocked the RARE tricorn pirate hat! This is a hat that my penguin Dino Boy7 doesn't have, so it's awesome that CP have decided to bring it back. The closest item to this I have is the Puffle Bandana.