The best way of doing it is a sustained 3 point campaign .
1 ) ship board defenses, just like on a bad street, the ability to defend your self makes you a less tempting target
2 ) Pirates caught in the act die, immediately. When the risk is higher than the profit it will become more difficult for them to recruit crews
3) ports that offer support services get the crap bombed out of them, merchants who supply them are assassinated.When it is purely profit with no direct risk the pirates are hero's. When it means that you may be killed for taking their money it is not so appealing.