{"id":8290,"date":"2026-05-15T09:45:23","date_gmt":"2026-05-15T07:45:23","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=8290"},"modified":"2026-06-15T01:00:15","modified_gmt":"2026-06-14T23:00:15","slug":"ascunderea-mesajelor-de-eroare-in-wordpress","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/hiding-error-messages-in-wordpress\/","title":{"rendered":"Cum s\u0103 ascunzi mesajele de eroare \u00een WordPress"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">By default, WordPress can display PHP warnings, notices, and other error messages when debugging is enabled. On production websites, displaying these messages is not recommended because they can expose sensitive information about your site&#8217;s configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To disable the public display of errors, edit the <code>wp-config.php<\/code> file located in your WordPress installation directory.<\/p>\n\n\n\n<\/div>\n\n<div id=\"mybox-3776037234\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">Find the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_DEBUG', true);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or add the following configuration before the line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/* That's all, stop editing! Happy publishing. *\/\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_DEBUG', false);\ndefine('WP_DEBUG_DISPLAY', false);\n@ini_set('display_errors', 0);\n<\/code><\/pre>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/hiding-error-messages-in-wordpress\/#What_these_settings_do\" >What these settings do<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/hiding-error-messages-in-wordpress\/#Logging_Errors_Instead_of_Displaying_Them\" >Logging Errors Instead of Displaying Them<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/hiding-error-messages-in-wordpress\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_these_settings_do\"><\/span>What these settings do<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>WP_DEBUG<\/code> disables WordPress debugging mode.<\/li>\n\n\n\n<li><code>WP_DEBUG_DISPLAY<\/code> prevents errors and warnings from being shown on the website.<\/li>\n\n\n\n<li><code>display_errors<\/code> instructs PHP not to display errors to visitors.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Logging_Errors_Instead_of_Displaying_Them\"><\/span>Logging Errors Instead of Displaying Them<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want WordPress to record errors without showing them publicly, use the following configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_DEBUG', true);\ndefine('WP_DEBUG_LOG', true);\ndefine('WP_DEBUG_DISPLAY', false);\n@ini_set('display_errors', 0);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress will then save error messages to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/wp-content\/debug.log\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This allows you to troubleshoot issues while keeping error messages hidden from visitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For production websites, it is recommended to disable the public display of errors and use error logging instead. This improves security, prevents visitors from seeing technical messages, and makes troubleshooting easier when issues occur.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[58],"manual_kb_tag":[7871,190,546,549,638,1098,4264,7868,7869,7870],"class_list":["post-8290","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-web-applications-cms","manual_kb_tag-production-websites","manual_kb_tag-wordpress","manual_kb_tag-wordpress-debugging","manual_kb_tag-debug-log","manual_kb_tag-wp-config-file","manual_kb_tag-error-messages","manual_kb_tag-display-errors","manual_kb_tag-debugging-mode","manual_kb_tag-hide-error-messages","manual_kb_tag-error-logging"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8290","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":4,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8290\/revisions"}],"predecessor-version":[{"id":8291,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/8290\/revisions\/8291"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=8290"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=8290"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=8290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}