Anyone can help me how to tun off error messages? I cant find the file where i must to edit...


bitradiator’s picture


netycia’s picture

There is no settings fot that

bitradiator’s picture

You must be logged in as user 1 (the account created when the site was installed) or as a user in a role with the appropriate permissions.

netycia’s picture

im administrator, and there is no settings for me...

hzakaryan’s picture

Go to Configuration => Logging and errors


ZogsterJack’s picture

In the page.tpl.php file within your theme/templates folder look for the following code:

<?php print $messages; ?>

and replace with:

<?php if($is_admin): ?>
 <?php print $messages; ?>
<?php endif; ?>

this will restrict the messages to only those people who have admin access permissions.

This worked perfectly for me in v6 using a Zen based theme
Hope this helps

jmbouvier’s picture

This looks like what I'm after. I don't want my anonymous users (or anyone who is not the administrator) to see error messages. Bartik's theme is slightly different and already has an if statement so could you tell me what to replace it with?

  <?php if ($messages): ?>
    <div id="messages"><div class="section clearfix">
      <?php print $messages; ?>
    </div></div> <!-- /.section, /#messages -->
  <?php endif; ?>

Thanks in advance

bitradiator’s picture

Try this:

<?php if (($messages) && ($user -> uid == 1): ?>
  <div id="messages"><div class="section clearfix">
    <?php print $messages; ?>
  </div></div> <!-- /.section, /#messages -->
<?php endif; ?>
jmbouvier’s picture

I replaced mine with yours and the website wouldn't load. Just blank white page.


bitradiator’s picture

I dropped a closing paren.

<?php if (($messages) && ($user -> uid == 1)): ?>
  <div id="messages"><div class="section clearfix">
    <?php print $messages; ?>
  </div></div> <!-- /.section, /#messages -->
<?php endif; ?>
jmbouvier’s picture



justinlevi’s picture

Won't this also hide confirmation messages and such? What if you just want to hide error messages but display successful messages like - your email has been sent after submitting a webform?

hzakaryan’s picture

Login As admin,

Go to Configuration => Logging and Errors => Error messages to display.


thoughtcat’s picture

I am seeing "The directory sites/default/files/images/temp is not writable" even when not logged in. Anonymous users are seeing this! (It's a temporary problem to do with my web hosting.)

admin/settings/error-reporting is set to "write errors to the log" (not to the screen).

I updated my page.tpl.php file with the suggested code:

print $messages;

but this message is still showing!

Help :-(

MiSc’s picture

Please post your complete code for that section.
But first of all, make sites/default/files/images/temp writeable.

// Mikke Schirén @

haopei’s picture


I don't see this "Error messages to display" option on the admin/settings/logging page.

All I see is "Data Logging" (Screenshot:

I am logged in as user1


This code seems to hide all messages (errors, warning, etc). Is there a better approach?

bitradiator’s picture

In D7: admin/config/development/logging

In D6: admin/settings/error-reporting

haopei’s picture

This works, thanks.

munyiva’s picture

This works

suffering drupal’s picture

Interesting thread, but should there be an option to show error messages only to Admin, instead of just NOT showing them?
I am having error messages covering all the screen on all pages INCLUDING for normal anonymous visitors. Hasn't Drupal thought of a simple solution to avoid this image-breaking situation for Drupal newbies who do not do PHP and stuff? (I'm a Newbie since 2007)

I started with Drupal in 2007 and then my life got stuck...

Jaypan’s picture

Hasn't Drupal thought of a simple solution to avoid this image-breaking situation

Who is this Drupal you speak of?

Because other than that, it's up to each user's initiative. Maybe others have thought about it, but no one has prioritized it enough to implement a solution.

aufumy’s picture

Try this:

Add to the "Messages to be disabled" textbox:

There are security updates available for one or more of your modules or themes.+
There is a security update available for your version of Drupal.+

under 'Page and user level filtering options', user id to disable: 1

drummondf’s picture

^ This ought to do it. Otherwise just pop in with Firebug and just {display: none;} it our of your CSS if it really isn't that important to you :)

Ask me about marketing

justaman’s picture

kikecastillo’s picture

Thanks! :)

syamanchal’s picture

how to remove the notice in drupal website

stutee’s picture

To remove notice from drupal website please follow below steps :
1. Go to admin/config/development/logging.
2. You have three choices:
None will disable all error reporting.
Errors and warnings will display on the most serious problems.
All messages will display all problems and is probably only useful for developers

Another way to disable notice and error message through code :
Add following code on settings.php file

vincentchun’s picture

... but maybe not the most elegant (I won't be the judge of that):

1. Create a block with visibility settings set to only show for anonymous users (or all users you want to hide the errors from, of course, excluding admins, if you wish)

2. Chuck this HTML/CSS code in:

div.messages--error {display:none;}

Of course, if you want to disable error messages altogether for all users, there's the global configuration setting - this is just a tip in the apparent absence of a role specific setting.

Patil_kunal27’s picture

Go to Configuration => Logging and Errors => Error messages to display