{"id":1601,"date":"2019-02-08T10:35:53","date_gmt":"2019-02-08T10:35:53","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2019\/02\/08\/1583189-how-to-hide-errors-and-warnings-on-your-website-in-hostinger\/"},"modified":"2026-03-16T12:12:18","modified_gmt":"2026-03-16T12:12:18","slug":"1583189-how-to-hide-errors-and-warnings-on-your-website-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/1583189-how-to-hide-errors-and-warnings-on-your-website-in-hostinger\/","title":{"rendered":"How to Hide Errors and Warnings on Your Website in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">While displaying PHP Errors and warnings can be useful for debugging your website, you may not want to have them on all the time. These messages can be turned off in several ways. Let&rsquo;s go over them in detail:<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"option-1---if-you-are-using-wordpress\">Option 1 &ndash; WordPress Configuration File<\/h2><p class=\"no-margin\">If your website is WordPress-based, go to the <b><a href=\"\/support\/4548688-basic-actions-in-file-manager\" target=\"_blank\" class=\"intercom-content-link\">File Manager<\/a><\/b> and open your <b>public_html\/wp-config.php<\/b> file. Next, check if any of these lines are present: <\/p><p class=\"no-margin\">\n<\/p><pre><code>define('WP_DEBUG', true);<br>define('WP_DEBUG', false); <\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">If either one of them or both are present, remove them. Next, add the following code: <\/p><p class=\"no-margin\">\n<\/p><pre><code>ini_set('display_errors','Off');<br>ini_set('error_reporting', E_ALL );<br>define('WP_DEBUG', false);<br>define('WP_DEBUG_DISPLAY', false);<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">And that&rsquo;s it! Now, PHP errors will not be displayed on your WordPress website &#128522; <\/p><hr><h2 id=\"opotion-2---htaccess-and-php-files\">Option 2 &ndash; .htaccess File<\/h2><p class=\"no-margin\">Go to the <b><a href=\"\/support\/4548688-basic-actions-in-file-manager\" target=\"_blank\" class=\"intercom-content-link\">File Manager<\/a><\/b> and open your <b>public_html\/.htaccess<\/b> file. If there is no .htaccess file, you can <b><a href=\"\/support\/1583307-how-to-create-an-htaccess-file\" target=\"_blank\" class=\"intercom-content-link\">create it<\/a><\/b>. Next, add the following line:<\/p><p class=\"no-margin\">\n<\/p><pre><code>php_flag display_errors off<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Save the changes, and the PHP errors will no longer be displayed on the website. <\/p><p class=\"no-margin\">\n<\/p><hr><h2 id=\"h_4490f220f7\">Option 3 &ndash; .php File<\/h2><p class=\"no-margin\">If you want to hide PHP errors from a single <b>session or page<\/b> of your website, go to the  <b><a href=\"\/support\/4548688-basic-actions-in-file-manager\" target=\"_blank\" class=\"intercom-content-link\">File Manager<\/a><\/b> and open the desired page&rsquo;s .php file. Next, add the following line:<\/p><p class=\"no-margin\">\n<\/p><pre><code>error_reporting(0);<\/code><\/pre><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">Save the changes, and now the PHP errors will be hidden on this particular page. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to hide PHP errors from your website, using hPanel, .htaccess, and configuration files<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[231],"tags":[],"class_list":["post-1601","post","type-post","status-publish","format-standard","hentry","category-php-errors"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/1583189-how-to-hide-errors-and-warnings-on-your-website-in-hostinger\/","default":1},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/support\/1583189-como-ocultar-los-errores-y-advertencias-en-tu-sitio-web-hostinger\/","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/support\/1583189-comment-masquer-les-erreurs-et-les-avertissements-sur-votre-site-web-hostinger\/","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/support\/1583189-cara-menyembunyikan-kesalahan-dan-peringatan-di-website-anda-hostinger\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/br\/support\/1583189-como-ocultar-erros-e-avisos-em-seu-site-hostinger\/","default":0},{"locale":"uk-UA","link":"https:\/\/www.hostinger.com\/ua\/support\/1583189-----\/","default":0}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=1601"}],"version-history":[{"count":0,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1601\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=1601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=1601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=1601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}