I think the Disable Messages module is what you need.
Gives a site owner options to disable specific messages shown to end users. The core drupal message system as offered by drupal_set_message is an excellent way for modules to send out messages to the end users. However not all drupal site owners are keen to show all the messages sent out by drupal core and all modules to their users. This module gives site administrators a reasonably powerful way to filter out messages shown to the end users.
Features
- Filter out messages that match a full text string exactly.
- Filter out messages that match a regular expression.
- Permissions to specifically hide all messages of a given type from any role.
- Disable all filtering for specific users.
- Disable all filtering for specific paths.
- Apply filtering only for specific paths.
- Debug system to get messages in the HTML without showing it to the end users.
-- HOW DOES IT WORKS? --
- install and enable the Disable Messages module
- Go to "/admin/config/development/disable-messages", and check the "Enable filtering"
- Go to "/admin/people/permissions", and give the permission who should "View status messages", "View warning messages", View error messages", and "Exclude from message filtering" if desired.
-- Updated July 31st 2015, 2:23pm --
CSS trick
to not display for anonymous user(not login)
body.not-logged-in div.messages.error { display: none; }
to not display for logged in user(you should not do this for admin user, but here is the trick)
body.logged-in div.messages.error { display: none; }