{"id":58,"date":"2023-06-07T19:05:14","date_gmt":"2023-06-07T23:05:14","guid":{"rendered":"https:\/\/hdplugins.com\/?post_type=documentation&#038;p=58"},"modified":"2026-01-26T12:48:01","modified_gmt":"2026-01-26T17:48:01","slug":"wordpress-debug-steps","status":"publish","type":"documentation","link":"https:\/\/hdplugins.com\/learn\/wordpress\/wordpress-debug-steps\/","title":{"rendered":"WordPress Debug Steps"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">WordPress sites can get complicated. With tens of thousands of different themes, and tens of thousands of plugins available, your site can have lots of different chefs in the kitchen \u2013 each adding their own <s>spice<\/s> code to modify WordPress in some way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes, the way these modifications were done, they can cause conflicts. This article will go over ways for you to <strong>debug<\/strong> your site to hopefully, at the very least, track down where the issue is originating from.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Enable <code>WP_DEBUG<\/code><\/h2>\n\n\n<div class=\"wp-block-image hdt_opacity\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"448\" src=\"https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-wp_debug.png\" alt=\"\" class=\"wp-image-59\" srcset=\"https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-wp_debug.png 832w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-wp_debug-300x162.png 300w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-wp_debug-768x414.png 768w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-wp_debug-500x269.png 500w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">If you have access to your hosting account and can edit files, the first thing to do is to temporarily enable <code>WP_DEBUG<\/code> mode. With this enabled, WordPress will be able to spit out some error messages, helping you figure out what the problem is and where it is coming from.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To enable <code>WP_DEBUG<\/code> you will need to log into your host and find a file <code>wp-config.php<\/code>, usually located in the same folder that WordPress is installed in (check the <code>public_html<\/code> folder).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this file, look for a <em>definition<\/em> called <code>WP_DEBUG<\/code>. It should be near the bottom of the file and look like <code>define('WP_DEBUG', false);<\/code>. All you need to do is change <code>false<\/code> to <code>true<\/code> and then save the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now, if you go to the page with the error, you will hopefully see some error messages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I also recommend adding the following below the <code>WP_DEBUG<\/code> constant for a more robust debug. The following code will only be active when you set <code>WP_DEBUG<\/code> to <code>true<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if (WP_DEBUG) {\n    @error_reporting(E_ALL);\n    @ini_set('log_errors', true);\n    define('WP_DEBUG_LOG', true);\n    define('WP_DEBUG_DISPLAY', false);\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">With the above, now logs will be saved in a file called <code>debug.log<\/code> that you can view, and enable \/ disable the logs along with the <code>WP_DEBUG<\/code> definition. The debug.log file can be in different locations depending on the source of the error, so if using something like cPanel, or if your host has a file manager, it&#8217;s probably best to search for the filename to quickly find its location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are not a coder, these messages will mostly look like gibberish to you, but the real value can be found by taking a look at the filename included in the message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example message:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Notice: Trying to get property 'data' of non-object in domain.com\/wp-content\/plugins\/example-plugin\/file.php on line 15<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You may have no idea what a &#8216;property&#8217; is or what &#8216;non-objects&#8217; are, but we can still use the file path to determine that this notice is coming from <code>file.php<\/code> which is a plugin file for a plugin called <code>example-plugin<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Just note that an error or notice doesn&#8217;t always mean that the error generator (the theme or plugin showing the message) is the <em>cause<\/em>. Sometimes other plugins can change core WordPress behaviour that other plugins rely on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, just remember to go back and edit <code>wp-config.php<\/code> again to set <code>WP_DEBUG<\/code> back to <code>false<\/code>. You don&#8217;t want your site showing error messages to all visitors.<\/p>\n\n\n\n<div class=\"hd_accordion_item\"><div class=\"hd_accordion_heading\" data-expanded=\"false\"><h3 class=\"hd_accordion_title\" data-expanded=\"false\"><button class=\"hd_accordion_button\" aria-expanded=\"false\">How to enable WP_DEBUG<\/button><\/h3><\/div><div class=\"hd_accordion_content\" aria-hidden=\"true\">\n<p class=\"wp-block-paragraph\">To enable <code>WP_DEBUG<\/code> in WordPress, you need to access your hosts file manager (or use FTP). In the root folder where you installed WordPress, look for a file called <code>wp-config.php<\/code>. Edit this file and set the variable <code>WP_DEBUG<\/code> to <code>true<\/code><\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">WordPress Debug Steps<\/h2>\n\n\n<div class=\"wp-block-image hdt_opacity\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"448\" src=\"https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-steps.png\" alt=\"\" class=\"wp-image-60\" srcset=\"https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-steps.png 832w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-steps-300x162.png 300w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-steps-768x414.png 768w, https:\/\/hdplugins.com\/wp-content\/uploads\/2023\/06\/wordpress-debug-steps-500x269.png 500w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">If you were able to use the <code>WP_DEBUG<\/code> method to track down where your errors are coming from, then a good test would be to deactivate the theme or plugin causing the errors to see if the problem is solved. If the issue is solved, then you can contact the authors of the offending theme or plugin and see if they can provide you with support. If not, you may need to consider looking for alternative options that do not have the offending error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are still unable to track down where the error is coming from, then the best course of action is to play the elimination game.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Temporarily Switch Themes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Just to test, temporarily switch themes (preferably to a default WordPress theme such as Twenty-Twenty-Three) and see if the problem persists.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the issue is no long present, then we know that the theme was the culprit. You will need to either change themes, or contact your theme developer for support.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Plugin Roulette<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the issue persists even after changing themes, then there is a good chance that the issue is related to one of your plugins.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Deactivate ALL plugins except the one you are testing and check to see if the issue remains.<\/li>\n\n\n\n<li>If plugin works, reactivate each plugin one-by-one, checking again each time until the issue returns.<\/li>\n\n\n\n<li>Once the issue returns, you will now know which was the offending plugin.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Contact Your Host<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some issues can be caused by your host, and thus only your host can fix for you. Somewhat common issues are <em>file uploads<\/em> or <em>resource limits<\/em> \u2013 issues that are usually host related. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if you are having problems uploading files, this can be caused by your hosting account not having the proper PHP Extensions enabled, or the <code>tmp<\/code> folder (folder where files are temporarily placed before being moved over to your main folder) being full, or even some security measures implemented by your host.<\/p>\n\n\n\n<div class=\"meta-summary\" class=\"wp-block-dbp-2001-callout-block\">\n\n<p class=\"wp-block-paragraph\">*tangent* \u21fe I recently spent far more time than I&#8217;d like to admit debugging a client&#8217;s site when I was unable to update a page. I just kept getting a <code>404<\/code> response, and couldn&#8217;t for the life of me figure out why. <\/p>\n\n\n<p class=\"wp-block-paragraph\">Turns out that the page had a link to pastebin.com which the host had on an internal blacklist.<\/p>\n\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">When all else fails, it&#8217;s always OK to ask your host for support. That&#8217;s part of what you pay them for, after all \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Having problems with your WordPress site? Is a plugin or page not working as you expect?<\/p>\n<p>Learn how you can easily track down the cause of your issues so that you can remove the problem or ask support from the right people.<\/p>\n","protected":false},"featured_media":59,"comment_status":"open","ping_status":"closed","template":"","tags":[45,44],"documentation_category":[17],"class_list":["post-58","documentation","type-documentation","status-publish","has-post-thumbnail","hentry","tag-tutorial","tag-wordpress","documentation_category-wordpress"],"_links":{"self":[{"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/documentation\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/types\/documentation"}],"replies":[{"embeddable":true,"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/comments?post=58"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/media\/59"}],"wp:attachment":[{"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/tags?post=58"},{"taxonomy":"documentation_category","embeddable":true,"href":"https:\/\/hdplugins.com\/hdapi\/wp\/v2\/documentation_category?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}