If you are using Drupal 6.x and Views 2.x or 3.x and the server your drupal installation is hosted on was recently updated from php 5.2 to 5.3 or 5.4 you might suddenly have to deal with warnings like the following ones:
The most annoying thing about those is that they are also being displayed to anonymous users and drupal has no build-in method to prevent this.
Why hiding all error messages through theming is a bad idea
There are a lot of howto articles out there, that suggest that it is a good idea to get rid of all error messages by hiding them through theming. It is a quick and easy fix but it is also a dirty one that potentially can create problems because of the following reasons:
If you don't care about these downsides and still want to do it: just open the template.php file inside your current templates directory and comment out or delete the block that starts with <?php if ($messages): ?> and ends with <?php endif; ?>. Be sure to double-check whether you edited the whole block because otherwise you might break your template and your site. If you have 5 more minutes be sure to read on, since a much cleaner workaround will only take that long.
How to hide only specific error messages to specific users
Thanks to contributer zyxware there is a module called "Disable Messages" that helps you with all issues connected to error- or warning messages on your site. Here how to get and install it:
To completely make use of this module you'll need to be a bit familiar with regular expressions. But since it is a rather complex topic, we want to get you starting by explaining how to hide all error messages with the word "static" to everyone, but by doing that not hiding "wrong password" or similar messages: