{"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-11-06T08:06:18","modified_gmt":"2026-11-06T08:06: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\">Hide errors and warnings on your website in Hostinger to keep PHP error messages away from visitors once you finish debugging. There are three methods: edit the WordPress wp-config.php file, add a rule to the .htaccess file, or hide errors on a single page through its .php file.<\/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 data-click-id=\"hgr-post-content-link-file-manager\" class=\"intercom-content-link\" href=\"\/support\/4548688-basic-actions-in-the-file-manager-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">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><pre><code>define('WP_DEBUG', true);\r\ndefine('WP_DEBUG', false); <\/code><\/pre><p class=\"no-margin\">If either one of them or both are present, remove them. Next, add the following code:<\/p><pre><code>ini_set('display_errors','Off');\r\nini_set('error_reporting', E_ALL );\r\ndefine('WP_DEBUG', false);\r\ndefine('WP_DEBUG_DISPLAY', false);<\/code><\/pre><p>PHP errors are now hidden on your WordPress website.<\/p><h2 id=\"opotion-2---htaccess-and-php-files\">Option 2 &ndash; .htaccess file<\/h2><p class=\"no-margin\">Go to the <b><a data-click-id=\"hgr-post-content-link-file-manager-2\" class=\"intercom-content-link\" href=\"\/support\/4548688-basic-actions-in-the-file-manager-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">File Manager<\/a><\/b> and open your <b>public_html\/.htaccess<\/b> file. If there is no .htaccess file, you can <b><a data-click-id=\"hgr-post-content-link-create-it\" class=\"intercom-content-link\" href=\"\/support\/1583307-how-to-create-an-htaccess-file-at-hostinger\/\" target=\"_blank\" rel=\"noopener\">create it<\/a><\/b>. Next, add the following line:<\/p><pre><code>php_flag display_errors off<\/code><\/pre><p class=\"no-margin\">Click <strong>Deploy<\/strong> to make the changes live, and the PHP errors will no longer be displayed on the website.<\/p><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 data-click-id=\"hgr-post-content-link-file-manager-3\" class=\"intercom-content-link\" href=\"\/support\/4548688-basic-actions-in-the-file-manager-in-hostinger\/\" target=\"_blank\" rel=\"noopener\">File Manager<\/a><\/b> and open the desired page&rsquo;s .php file. Next, add the following line:<\/p><pre><code>error_reporting(0);<\/code><\/pre><p class=\"no-margin\">Click <strong>Deploy<\/strong> to make the changes live, and now the PHP errors will be hidden on this particular page.<\/p><p>PHP errors and warnings are now hidden from your website visitors. To show them again while debugging, see <a data-click-id=\"hgr-post-content-link-how-to-display-php-error-messages-in-hostinger\" href=\"\/support\/4259219-how-to-display-php-error-messages-in-hostinger\/\">How to display PHP error messages in Hostinger.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hide errors and warnings on your website in Hostinger using the WordPress wp-config.php file, the .htaccess file, or a single .php file.<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_content_updated_date":"","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-BR","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-\u044f\u043a-\u043f\u0440\u0438\u0445\u043e\u0432\u0430\u0442\u0438-\u043f\u043e\u043c\u0438\u043b\u043a\u0438-\u0442\u0430-\u043f\u043e\u043f\u0435\u0440\u0435\u0434\u0436\u0435\u043d\u043d","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":6,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1601\/revisions"}],"predecessor-version":[{"id":24796,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/1601\/revisions\/24796"}],"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}]}}