{"id":1954527,"date":"2022-08-12T06:38:04","date_gmt":"2022-08-12T10:38:04","guid":{"rendered":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/?post_type=tribe-knowledgebase&#038;p=1953889"},"modified":"2025-05-01T15:44:05","modified_gmt":"2025-05-01T19:44:05","slug":"how-to-enable-debugging-in-wordpress","status":"publish","type":"post","link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/how-to-enable-debugging-in-wordpress\/","title":{"rendered":"How to Enable Debugging in WordPress"},"content":{"rendered":"\n<p>Enabling debugging in WordPress is a great troubleshooting step to help you see what&#8217;s going on with your website. This is best done on a <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/creating-and-using-a-wordpress-staging-site\/\" target=\"_blank\" rel=\"noreferrer noopener\">staging site<\/a> or <em>temporarily <\/em>on a live site, as it can cause error or warning messages to show in the WordPress dashboard or on your site. Any errors or warnings will be logged in the <a href=\"https:\/\/wordpress.org\/support\/article\/debugging-in-wordpress\/\" target=\"_blank\" rel=\"noreferrer noopener\">WP_DEBUG_LOG<\/a>.<\/p>\n\n\n\n<p><strong>There are two basic ways to enable debugging: by <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/how-to-enable-debugging-in-wordpress\/#wp-config-php\">editing the wp-config.php file<\/a> or <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/how-to-enable-debugging-in-wordpress\/#debug-plugin\">using a debugging plugin<\/a>.<\/strong> Using a plugin is a good option for less technical users. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"wp-config-php\">Enable debugging via wp-config.php file<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-locate-the-wp-config-php-file\">Locate the wp-config.php file<\/h4>\n\n\n\n<p>By default, debugging is turned off in WordPress. To enable it, you&#8217;ll first want to locate your <code>wp-config.php<\/code> file. You\u2019ll need to access your site files through either an FTP (File Transfer Protocol) or your server\u2019s cPanel to find this. To learn more about using FTP, check out <a href=\"https:\/\/staging.theeventscalendar.com\/knowledgebase\/k\/using-ftp\/\" target=\"_blank\" rel=\"noreferrer noopener\">this Knowledgebase article<\/a>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-edit-the-wp-config-php-file\">Edit the wp-config.php file<\/h4>\n\n\n\n<p>Once you&#8217;ve located the file, you can open and edit the <code>wp-config.php<\/code> file. This file contains site-specific configuration settings, such as database information and, potentially, settings added by your hosting provider. For debugging, you\u2019ll need to find the following line of code, which is generally located towards the bottom of the file:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n(&#039;WP_DEBUG&#039;,false);\n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\" id=\"h-add-your-debugging-code\">Add your debugging code<\/h4>\n\n\n\n<p>Now you can overwrite the above line of code with the following code to enable debugging on your WordPress site:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n\/\/ Enable WP_DEBUG mode\ndefine( &#039;WP_DEBUG&#039;, true );\n \n\/\/ Enable Debug logging to the \/wp-content\/debug.log file\ndefine( &#039;WP_DEBUG_LOG&#039;, true );\n \n\/\/ Disable display of errors and warnings\ndefine( &#039;WP_DEBUG_DISPLAY&#039;, false );\n@ini_set( &#039;display_errors&#039;, 0 );\n \n\/\/ Use dev versions of core JS and CSS files (only needed if you are modifying these core files)\ndefine( &#039;SCRIPT_DEBUG&#039;, true );\n<\/pre><\/div>\n\n\n<p>Be sure to add the above code before the following line:<\/p>\n\n\n\n<p><code>\/* That's all, stop editing! Happy blogging. *\/<\/code><\/p>\n\n\n\n<p><strong>You can now find your debug log at <\/strong><code>https:\/\/yoursitename.com\/wp-content\/debug.log<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"debug-plugin\">Enable debugging via plugin<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-wp-debugging\">WP Debugging<\/h3>\n\n\n\n<p><a href=\"https:\/\/wordpress.org\/plugins\/wp-debugging\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>WP Debugging<\/strong><\/a> is a free plugin that allows you to enable debugging and record bugs without having to edit any files. Once the plugin is installed and active, you can view your debug log by going selecting <em>Debug Quick Look <\/em> <em>> View File<\/em> from the top of your WordPress Dashboard.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"193\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/10\/wp-debugging-plugin-view-file-1024x193.png\" alt=\"\" class=\"wp-image-1954346\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/10\/wp-debugging-plugin-view-file-1024x193.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/10\/wp-debugging-plugin-view-file-300x57.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/10\/wp-debugging-plugin-view-file-768x145.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/10\/wp-debugging-plugin-view-file.png 1505w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Keep in mind that the log records issues as they happen. So in order for an issue to get logged, you need to repeat the actions that led to the issue you&#8217;re trying to troubleshoot. For example, if we&#8217;ve asked you to share the debug log to troubleshoot a critical error, you&#8217;d follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><em>Debug Quick Look &gt; Purge File<\/em>. That clears any past errors from the log so it&#8217;s easy for us to see the relevant information.<\/li>\n\n\n\n<li>On your site, go to the page where you saw the critical error.<\/li>\n\n\n\n<li>Go back to the Dashboard and select <em>Debug Quick Look &gt; View File<\/em>.<\/li>\n\n\n\n<li>Copy all the text you see there into your support ticket.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-debug-log-manager\">Debug Log Manager<\/h3>\n\n\n\n<p>The <strong><a href=\"https:\/\/wordpress.org\/plugins\/debug-log-manager\/\">Debug Log Manager<\/a><\/strong> is a helpful plugin designed to simplify the process of managing WordPress debug logs. Instead of manually accessing and editing the <code>wp-config.php<\/code> file or digging through your server\u2019s file system to view logs, this plugin provides an easy-to-use interface right from your WordPress admin dashboard.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Key Features:<\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Clear Logs with One Click<\/strong>: Easily remove old or unnecessary log entries to keep your site clean and efficient.<\/li>\n\n\n\n<li><strong>View Logs in Dashboard<\/strong>: Access and read the contents of the <code>debug.log<\/code> file directly from the admin panel.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"522\" src=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-1024x522.png\" alt=\"\" class=\"wp-image-1964943\" srcset=\"https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-1024x522.png 1024w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-300x153.png 300w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-768x392.png 768w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-1536x783.png 1536w, https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/DebugLogManager-min-2048x1044.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Once you\u2019ve installed and activated the <strong>Debug Log Manager<\/strong> plugin, follow these steps to check for error logs:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Navigate to<\/strong> <code>Tools > Debug Log Manager<\/code> in your WordPress dashboard.<\/li>\n\n\n\n<li><strong>Enable<\/strong> both <strong>Error Logging<\/strong> and <strong>Auto-Refresh<\/strong> options to monitor logs in real time.<\/li>\n\n\n\n<li>Click the <strong>Clear Log<\/strong> button to start with a clean log file.<\/li>\n\n\n\n<li>In a <strong>new browser tab or page<\/strong>, replicate the issue you\u2019re trying to debug (e.g., trigger the error or perform the action causing trouble).<\/li>\n\n\n\n<li>Return to the <strong>Debug Log Manager<\/strong> tab\/page and check for any logged messages\u2014particularly <strong>Fatal Errors<\/strong> or <strong>Warnings<\/strong>.<\/li>\n\n\n\n<li><strong>Copy or download the log output<\/strong> and share it with the support team for further investigation.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"warnings-and-errors\">Warnings and errors<\/h2>\n\n\n\n<p>Now that you&#8217;ve enabled debugging, you may notice a lot of warnings and errors that you didn&#8217;t previously know about. It&#8217;s important to note that <em>warnings <\/em>are nothing to be concerned about. Warnings are simply there to help developers during the plugin development phase. When exploring your debug log, you should look out for <strong>fatal errors<\/strong>, as those may be causing issues with your site. However, warnings should not pose any threat to your site, so you can simply ignore those.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enabling debugging in WordPress is a great troubleshooting step to help you see what&#8217;s going on with your website. This is best done on a staging site or temporarily on a live site, as it can cause error or warning messages to show in the WordPress dashboard or on your site. Any errors or warnings&#8230;<\/p>\n","protected":false},"author":5,"featured_media":1954561,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_swpsp_post_exclude":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"kb-single","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"ep_exclude_from_search":false,"footnotes":""},"categories":[93],"tags":[85],"stellar-product-taxonomy":[161],"class_list":["post-1954527","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-errors","tag-testing","stellar-product-taxonomy-the-events-calendar"],"acf":[],"taxonomy_info":{"category":[{"value":93,"label":"Troubleshooting"}],"post_tag":[{"value":85,"label":"testing"}],"stellar-product-taxonomy":[{"value":161,"label":"The Events Calendar"}]},"featured_image_src_large":["https:\/\/images.theeventscalendar.com\/kb\/uploads\/2022\/08\/kb-guide-banner-virtual-events-1024x224.jpeg",1024,224,true],"author_info":{"display_name":"Leah","author_link":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/author\/leahk\/"},"comment_info":0,"category_info":[{"term_id":93,"name":"Troubleshooting","slug":"errors","term_group":0,"term_taxonomy_id":93,"taxonomy":"category","description":"","parent":0,"count":67,"filter":"raw","term_order":"0","cat_ID":93,"category_count":67,"category_description":"","cat_name":"Troubleshooting","category_nicename":"errors","category_parent":0}],"tag_info":[{"term_id":85,"name":"testing","slug":"testing","term_group":0,"term_taxonomy_id":85,"taxonomy":"post_tag","description":"","parent":0,"count":11,"filter":"raw","term_order":"0"}],"_links":{"self":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954527","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=1954527"}],"version-history":[{"count":3,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954527\/revisions"}],"predecessor-version":[{"id":1964944,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/1954527\/revisions\/1964944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media\/1954561"}],"wp:attachment":[{"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=1954527"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=1954527"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=1954527"},{"taxonomy":"stellar-product-taxonomy","embeddable":true,"href":"https:\/\/staging.theeventscalendar.com\/knowledgebase\/wp-json\/wp\/v2\/stellar-product-taxonomy?post=1954527"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}