{"id":10686,"date":"2026-06-15T09:51:44","date_gmt":"2026-06-15T07:51:44","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=10686"},"modified":"2026-06-15T09:51:45","modified_gmt":"2026-06-15T07:51:45","slug":"how-to-enable-wordpress-debug-mode","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/","title":{"rendered":"How to enable WordPress debug mode"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">WordPress debug mode helps display or save technical errors that are not always visible on the website. It is useful when a WordPress website shows a blank page, a critical error, a 500 error, or unexpected behavior after a plugin, theme, or PHP change.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Debug mode should usually be enabled only while troubleshooting. After the issue is identified, it should be disabled again to avoid storing unnecessary error logs or showing technical information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\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 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#Before_you_start\" >Before you start<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#How_to_enable_debug_mode_in_WordPress\" >How to enable debug mode in WordPress<\/a><\/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\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#Where_WordPress_saves_the_debug_log\" >Where WordPress saves the debug log<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#What_the_debug_settings_mean\" >What the debug settings mean<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#If_the_website_shows_a_500_error\" >If the website shows a 500 error<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#If_the_error_points_to_a_plugin\" >If the error points to a plugin<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#How_to_disable_debug_mode\" >How to disable debug mode<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#What_to_expect\" >What to expect<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-enable-wordpress-debug-mode\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_you_start\"><\/span>Before you start<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-4035289200\" 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\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/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\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">To enable WordPress debug mode, you need access to the website files. The setting is added in the <code>wp-config.php<\/code> file, which is located in the main WordPress directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can access the file by using FTP or SFTP.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Related article: <a href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/how-to-create-a-new-ftp-account\/\">How to Create a New FTP Account<\/a><\/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=\"How_to_enable_debug_mode_in_WordPress\"><\/span>How to enable debug mode in WordPress<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Connect to your website files using FTP or SFTP.<\/li>\n\n\n\n<li>Open the main directory of your WordPress website.<\/li>\n\n\n\n<li>Find the file named <code>wp-config.php<\/code>.<\/li>\n\n\n\n<li>Download a backup copy of the file before editing it.<\/li>\n\n\n\n<li>Open <code>wp-config.php<\/code> in a text editor.<\/li>\n\n\n\n<li>Look for this line:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG', false );\n<\/code><\/pre>\n\n\n\n<ol start=\"7\" class=\"wp-block-list\">\n<li>Replace it with the following code:<\/li>\n<\/ol>\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<ol start=\"8\" class=\"wp-block-list\">\n<li>Save the file.<\/li>\n\n\n\n<li>Upload the updated <code>wp-config.php<\/code> file back to the server if you edited it locally.<\/li>\n\n\n\n<li>Open the website again and repeat the action that caused the problem.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress will now save detected errors in a log file instead of showing them directly to 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=\"Where_WordPress_saves_the_debug_log\"><\/span>Where WordPress saves the debug log<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When <code>WP_DEBUG_LOG<\/code> is enabled, WordPress usually saves errors in this file:<\/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\">Open this file after reproducing the issue. The newest errors are usually added at the bottom of the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The log may mention a plugin, theme, PHP function, missing file, or database issue. This information helps identify what is causing the problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Related article: <a href=\"https:\/\/mybox.com\/help\/knowledgebase\/how-to-check-for-errors-in-wordpress\/\">How to Check for Errors in CMS WordPress<\/a><\/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=\"What_the_debug_settings_mean\"><\/span>What the debug settings mean<span class=\"ez-toc-section-end\"><\/span><\/h2>\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\">This enables WordPress debug mode.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG_LOG', true );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This tells WordPress to save errors to a log file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG_DISPLAY', false );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This prevents errors from being displayed directly on the website.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ini_set( 'display_errors', 0 );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This helps keep technical errors hidden from visitors while they are still saved in the log.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This configuration is usually safer for live websites because it records errors without displaying them publicly.<\/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=\"If_the_website_shows_a_500_error\"><\/span>If the website shows a 500 error<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A 500 error means the server could not complete the request. In WordPress, this is often caused by a plugin, theme, PHP version change, corrupted file, or configuration issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After enabling debug mode, check the <code>debug.log<\/code> file for the exact error message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Related article: <a href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/error-500-internal-server-error\/\">Error 500 Internal Server Error<\/a><\/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=\"If_the_error_points_to_a_plugin\"><\/span>If the error points to a plugin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the debug log shows that a plugin is causing the problem, you can disable that plugin without logging in to the WordPress admin panel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is useful when the WordPress dashboard is not accessible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Related article: <a href=\"https:\/\/mybox.com\/help\/knowledgebase\/how-to-disable-a-wordpress-plugin-via-ftp\/\">How to Disable a Plugin in WordPress Without Accessing the Backend<\/a><\/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=\"How_to_disable_debug_mode\"><\/span>How to disable debug mode<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After troubleshooting, open <code>wp-config.php<\/code> again and change debug mode back to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'WP_DEBUG', false );\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also remove these lines if they were added only for troubleshooting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( '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\">If the <code>wp-content\/debug.log<\/code> file contains many old errors, you can download it for reference and then remove it from the server.<\/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=\"What_to_expect\"><\/span>What to expect<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Debug mode does not fix the problem by itself. It helps show where the problem is coming from.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In most cases, the log points to a plugin, theme, PHP compatibility issue, missing file, or database-related error. Once the cause is known, the next step is to update, disable, repair, or reconfigure the affected part of the website.<\/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\">WordPress debug mode is used to collect technical error information during troubleshooting. The safest approach on a live website is to save errors in <code>wp-content\/debug.log<\/code> while keeping them hidden from visitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After the issue is identified, debug mode should be disabled again.<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[58],"manual_kb_tag":[2179,2940,4258,4259,4260,4261,4262,4263,4264,4265],"class_list":["post-10686","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-web-applications-cms","manual_kb_tag-wordpress-config-file","manual_kb_tag-wordpress-debug-mode","manual_kb_tag-enable-debug-mode","manual_kb_tag-disable-debug-mode","manual_kb_tag-edit-wordpress-config-file","manual_kb_tag-wordpress-debug-log","manual_kb_tag-debug-log-file","manual_kb_tag-save-error-logs","manual_kb_tag-display-errors","manual_kb_tag-php-error-log"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/10686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/10686\/revisions"}],"predecessor-version":[{"id":10687,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/10686\/revisions\/10687"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=10686"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=10686"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=10686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}