{"id":54,"date":"2020-01-16T00:00:00","date_gmt":"2020-01-16T00:00:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=54"},"modified":"2020-11-29T19:30:26","modified_gmt":"2020-11-29T19:30:26","slug":"how-to-turn-off-drupal-messages","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/how-to-turn-off-drupal-messages\/","title":{"rendered":"How to turn off drupal messages"},"content":{"rendered":"\n<p>A red error message displaying on your webpage, visible to every visitor is the worst thing you can do to your site. Unfortunately, drupal displays error messages on the screen by default. There are several solutions to this problem.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. Install disable_messages plugin<\/h4>\n\n\n\n<p>The&nbsp;<a target=\"_blank\" href=\"http:\/\/drupal.org\/project\/disable_messages\" rel=\"noreferrer noopener\">disable messages<\/a>&nbsp;plugin is only available for drupal 6 and drupal 7.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. Edit page.tpl file<\/h4>\n\n\n\n<p>Remove the following piece of code from your page.tpl file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ($show_messages &amp;&amp; $messages): print $messages; endif;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. Edit style.css file<\/h4>\n\n\n\n<p>Go into your style.css file and find the block for error messages. Then add the following line to it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>display: none<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">4. Edit error reporting preferences<\/h4>\n\n\n\n<p>Go to Administer &gt; Site Configuration &gt; Error Reporting Set Write error messages to the log and to the screen to Write error messages to the log<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A red error message displaying on your webpage, visible to every visitor is the worst thing you can do to your site. Unfortunately, drupal displays error messages on the screen by default. There are several solutions to this problem. 1. Install disable_messages plugin The&nbsp;disable messages&nbsp;plugin is only available for drupal 6 and drupal 7. 2. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[21],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-drupal","tag-drupal"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/54\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}