The only way to hide an individual message would be to create a custom dialog which displays the player messages, and always hide the default message display.
Then you could simply not add the messages that start with "/" to your custom message dialog.
Using triggers, how do I make it such that if player 1 chats "/a1", the chat message gets hidden?
@Chris97Ong: Go
you can only hide all chat messages with the UI - action. so register an event player types /a1 and as action delete all chat messages.
@Chris97Ong: Go
The only way to hide an individual message would be to create a custom dialog which displays the player messages, and always hide the default message display.
Then you could simply not add the messages that start with "/" to your custom message dialog.
All messages starting with "/" are hidden/disabled on Battlenet already - the slash is reserved for Battlenet commands.