{"id":631,"date":"2026-07-01T03:45:56","date_gmt":"2026-07-01T03:45:56","guid":{"rendered":"https:\/\/brutefort.com\/blog\/how-to-enable-wordpress-debugging\/"},"modified":"2026-07-15T13:43:36","modified_gmt":"2026-07-15T13:43:36","slug":"how-to-enable-wordpress-debugging","status":"publish","type":"post","link":"https:\/\/brutefort.com\/blog\/how-to-enable-wordpress-debugging\/","title":{"rendered":"How to Enable WordPress Debugging (The Safe Way for Live Sites)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1124\" height=\"750\" src=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/pexels-photo-3861972.jpeg\" alt=\"Developer enabling WordPress debugging mode on a laptop\" class=\"wp-image-630\" srcset=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/pexels-photo-3861972.jpeg 1124w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/pexels-photo-3861972-300x200.jpeg 300w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/pexels-photo-3861972-1024x683.jpeg 1024w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/pexels-photo-3861972-768x512.jpeg 768w\" sizes=\"auto, (max-width: 1124px) 100vw, 1124px\" \/><figcaption>Photo by ThisIsEngineering from Pexels<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You want to see what&#8217;s actually breaking on your WordPress site, but you&#8217;re worried that flipping on debug mode will spill PHP errors onto the screen for every visitor to see. That worry is justified \u2014 it happens to sites that get one setting wrong.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The good news: enabling WordPress debugging safely is a five-minute job once you know which three constants to set, and in what combination. PHP fatal errors, warnings, notices, and deprecated function calls are normally suppressed entirely. Once debugging is configured correctly, they get written to a private log file instead \u2014 visible to you, invisible to visitors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide covers the complete, safe way to enable WordPress debugging on a live site, plus the one combination of settings that will expose errors publicly if you get it wrong.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Quick Answer:<\/strong> Set <code>WP_DEBUG<\/code> to true, <code>WP_DEBUG_LOG<\/code> to true, and <code>WP_DEBUG_DISPLAY<\/code> to false in <code>wp-config.php<\/code>. That combination logs every PHP error to a file silently, without printing anything to the page. Skip the file entirely by using LogMate&#8217;s dashboard toggle instead.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Three Constants You Need<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WordPress debugging is controlled by constants in <code>wp-config.php<\/code>. You need all three of these set correctly for safe, effective error logging on a production site:<\/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 );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Place these above the line that reads <code>\/* That's all, stop editing! Happy publishing. *\/<\/code><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>WP_DEBUG<\/strong> \u2014 the master switch. It enables error reporting in PHP. Without this set to true, the other two constants do nothing.<\/li><li><strong>WP_DEBUG_LOG<\/strong> \u2014 writes errors to a file instead of doing anything visible. This creates (or appends to) <code>\/wp-content\/debug.log<\/code>, which becomes your WordPress debug log.<\/li><li><strong>WP_DEBUG_DISPLAY<\/strong> \u2014 controls whether errors print to the page. Its default is <code>true<\/code>. So if you only set WP_DEBUG without explicitly setting this to false, PHP errors will print to your pages for every visitor to see. <strong>Warning:<\/strong> always set this to false on a live site.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For extra safety, add this line too. It suppresses error display at the PHP level in case a plugin overrides WP_DEBUG_DISPLAY:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@ini_set( 'display_errors', 0 );<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Where the WordPress Debug Log Is Written<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">With <code>WP_DEBUG_LOG<\/code> set to true, WordPress writes errors to <code>\/wp-content\/debug.log<\/code>. That&#8217;s the default WordPress error log location. Some hosting environments write it elsewhere \u2014 LogMate&#8217;s System Info screen shows the exact path for both your PHP log and JS log files on your specific installation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Reading the raw log file means FTP or file manager access every time something breaks. LogMate reads it for you from inside the WordPress admin instead \u2014 filterable, searchable, with occurrence counts and timestamps \u2014 so you can check your error log the same way you&#8217;d check any other dashboard screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"355\" src=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-website-error-logs.webp\" alt=\"LogMate main logs table showing log type, error type, message, source, occurrences, and last occurrence with filter and export options\" class=\"wp-image-682\" srcset=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-website-error-logs.webp 1024w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-website-error-logs-300x104.webp 300w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-website-error-logs-768x266.webp 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<div class=\"wp-block-stackable-button-group stk-block-button-group stk-block stk-5c2a8f9\" data-block-id=\"5c2a8f9\"><div class=\"stk-row stk-inner-blocks stk-block-content stk-button-group\">\n<div class=\"wp-block-stackable-button stk-block-button stk-block stk-9d3b7e1\" data-block-id=\"9d3b7e1\"><style>.stk-9d3b7e1 .stk-button{background:#f13434 !important;border-top-left-radius:var(--stk--preset--border-radius--small, 4px) !important;border-top-right-radius:var(--stk--preset--border-radius--small, 4px) !important;border-bottom-right-radius:var(--stk--preset--border-radius--small, 4px) !important;border-bottom-left-radius:var(--stk--preset--border-radius--small, 4px) !important;}.stk-9d3b7e1 .stk-button:before{border-color:#0f0e17 !important;}<\/style><a class=\"stk-link stk-button stk--hover-effect-darken\" href=\"https:\/\/brutefort.com\/blog\/best-security-plugins-wordpress\/\"><span class=\"stk-button__inner-text\">Get LogMate Now!<\/span><\/a><\/div>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling SCRIPT_DEBUG for JavaScript Errors<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The three constants above handle PHP error logging. For JavaScript errors, there&#8217;s a separate constant: <code>SCRIPT_DEBUG<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define( 'SCRIPT_DEBUG', true );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This forces WordPress to load full, unminified versions of its own core scripts. That makes JavaScript error messages in the browser console readable rather than cryptic references into compressed bundles. Use it during active debugging sessions and disable it when done.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">LogMate&#8217;s settings panel lets you toggle SCRIPT_DEBUG directly from the WordPress admin without editing <code>wp-config.php<\/code>. It also captures WordPress JavaScript errors from visitor browser sessions server-side, so you see browser-side errors even from visitors you&#8217;re not actively watching, without needing SCRIPT_DEBUG permanently on.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"913\" height=\"404\" src=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-log-settings.webp\" alt=\"LogMate Settings panel with Enabled toggle, auto-refresh interval, log JavaScript errors option, and Modify SCRIPT_DEBUG toggle\" class=\"wp-image-680\" srcset=\"https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-log-settings.webp 913w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-log-settings-300x133.webp 300w, https:\/\/brutefort.com\/blog\/wp-content\/uploads\/2026\/07\/logmate-log-settings-768x340.webp 768w\" sizes=\"auto, (max-width: 913px) 100vw, 913px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Enabling Debugging Without Editing wp-config.php<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your hosting provider&#8217;s control panel offers a debug mode toggle \u2014 as cPanel, Kinsta, WP Engine, and others do \u2014 you can enable WP_DEBUG from there without touching the config file. Check your host&#8217;s documentation for the specific option.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For SCRIPT_DEBUG specifically, LogMate handles the toggle from inside the dashboard. For the PHP debugging constants, a code snippets plugin that lets you add PHP to wp-config.php from the admin is another option, though FTP access to the config file is the most reliable method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently Asked Questions About Enabling WordPress Debugging<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is it safe to enable WP_DEBUG on a live site?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, with WP_DEBUG_DISPLAY set to false. Errors go to the log file silently without any visible change for your visitors. The risk is only when WP_DEBUG_DISPLAY is left at its default of true, which prints errors to the page. Always explicitly set it to false in a production environment.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Will enabling debugging make my site slower?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Very slightly. PHP error checking adds minimal overhead to each request, and file writes to the debug log add a small amount of disk I\/O. On most sites this is imperceptible. Where it becomes noticeable is on sites already generating thousands of log entries per hour \u2014 in that case, the high error volume is the performance concern, not the debug mode itself.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">My debug log is filling up fast. What should I do?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A rapidly filling debug log almost always means a plugin or theme is generating the same WordPress PHP error on every page load. Open LogMate&#8217;s Logs screen and sort by occurrence count \u2014 the entry with the highest count is almost certainly the culprit. Once you identify the source, address it (update the plugin, contact the developer, or deactivate it temporarily) and set up LogMate&#8217;s automatic log retention to keep the file size manageable going forward.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I disable WordPress debugging when I&#8217;m done?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Set WP_DEBUG back to false in <code>wp-config.php<\/code>, or remove the define statement entirely. WordPress stops writing to the debug log immediately. The existing log file remains on disk until you delete or purge it \u2014 LogMate&#8217;s purge function handles this from the settings panel without needing server access.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Enabling WordPress debugging is a five-minute setup that gives you complete visibility into what your site is doing under the hood. The key is always setting WP_DEBUG_DISPLAY to false before going live. <a href=\"https:\/\/wordpress.org\/plugins\/logmate\/\" target=\"_blank\" rel=\"noopener\">LogMate<\/a> handles reading those logs from inside your dashboard, adds JavaScript error capture on top, and manages log retention automatically.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You might also like:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/brutefort.com\/blog\/wordpress-wp-debug-explained\/\">WordPress WP_DEBUG Explained: What It Does and How to Use It Safely<\/a><\/li><li><a href=\"https:\/\/brutefort.com\/blog\/wordpress-debug-log\/\">WordPress Debug Log: What It Is and How to Use It<\/a><\/li><li><a href=\"https:\/\/brutefort.com\/blog\/how-to-view-wordpress-error-logs\/\">How to View WordPress Error Logs (Every Method Explained)<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Enabling WordPress debugging captures PHP errors silently in a log file. Here&#8217;s the exact configuration that&#8217;s safe for production, and how to read the log without server access.<\/p>\n","protected":false},"author":1,"featured_media":630,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-631","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debugging"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":1,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":702,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions\/702"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/media\/630"}],"wp:attachment":[{"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/media?parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/categories?post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/brutefort.com\/blog\/wp-json\/wp\/v2\/tags?post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}