Troubleshooting WordPress

Troubleshooting WordPress

I’ve been doing WordPress now for 2 years and in this post I wanted to explore some of the most common problems you will run into as a WordPress admin or developer, from minor plugin bugs that cause annoying and unsightly errors to display to the frontend for no reason, to the dreaded WordPress white screen of death “There has been a Critical Error on this site”, or the “ghost” bugs caused by high profile security plugins. Let’s Dive! 

Tips for Debugging

  • Activate WP_DEBUG, WP_DEBUG_LOG, and / or WP_DEBUG_DISPLAY by setting these settings to true in the wp-config.php file of your WordPress install. See my tutorial here: https://phoenixignited.tech/wp_debug/
  • Read and understand any error messages the site is displaying, often these error messages will provide insights into the underlying cause of the problem.
  • Deactivate plugins / themes, either all of them or ones you particularly suspect of causing the issue (proceed with caution)
  • If WordPress sends you an email with the cause of the incident it may contain additional error info

Frontend Error Displaying Bugs

One type of bug you will come across here and there as you learn WordPress is error messages displaying to the frontend. These are extremely unsightly and overall just annoying, but they are also not too hard to remediate. Almost always it is a plugin that is in a situation for which the developers did not anticipate, often times these frontend errors can be “suppressed” via setting the WP_DEBUG and WP_DEBUG_DISPLAY settings to false in the wp-config.php file in the WordPress install. Sometimes though this just doesn’t work. In these cases you will either have to determine what is causing the issue under the hood and fix it, remove the widget that is causing the issue, or if that isn’t an option remove the plugin. 

Remediation: 

  • Suppress error messages via setting WP_DEBUG and WP_DEBUG_DISPLAY to false in wp-config.php
  • Determine what is causing the issue (Normally the error will include the plugin, file, and line where the error occurred, as well as what caused it at the programming level, if you can read the code, try to determine what is the root of the problem, I’ve had one situation where a specific setting just needed a numerical input where the default value was NULL and caused it this type of bug).
  • Abandon the specific widget that is causing the problem
  • Abandon the entire plugin that is causing the problem

White Screen of Death

If you haven’t seen it, you’ve probably heard of it, the WordPress “white screen of death” is infamous in the WordPress community and the most common fix is to get rid of the plugin or theme that caused the conflict. To determine what plugin / theme caused the conflict, you can deactivate all plugins and themes and re-activate them one by one, or if as is often the case the error message tells you what plugin is breaking the site, you can save yourself some time. Often it won’t be a plugin conflicting with the WordPress core, (although this can happen especially with unmaintained plugins) but rather two plugins conflicting with each other in which case you can remove the one you need the least. From my experience the error message will only display half the equation, and will tell you that plugin A broke your site, even though plugin A had a conflict with plugin B and plugin B was therefore equally responsible, so you might have to go deactivating and reactivating all of your plugins one by one in the end to find the second conflicting plugin anyways. Plugins conflicting with themes is also common. In some situations you may not have to remove any of the conflicting plugins or themes if there is another way to fix the issue (such as by disabling a feature in one of the plugins that caused the issue, manually debugging the code yourself, etc.) 

Remediation: 

  • Determine the root source (theme or plugin) of the problem and deactivate
  • If there is a simpler fix, or if you can code, fix the problem that way

"Ghost" Bugs

Ghost bugs can be difficult to debug simply because they don’t say anything. Often they are caused by security plugins blocking a specific action as the action seems malicious to the plugin ( Caching plugins can also cause the issue though). Most common “ghost” bugs from my experience are adjusting settings, but the settings don’t update or executing tasks, but the tasks don’t actually execute. I have spent hours debugging these “ghost” bugs before realizing the “oh duh”. Remediation will depend on the security solution involved, I’ve dealt with both WordFence and Sucuri quite extensively and they have both caused these bugs. Should you get rid of the security plugin? No, I have never had a “ghost” bug that I can’t whitelist somehow in the plugin’s settings. Whether it be whitelisting an “action”, url path, or ip address, you should definitely be able to fix the issue, once you realize what is causing it.

Remediation: 

  • Temporarily deactivate the active security plugins to determine if the security plugins are indeed causing the issue (depends on the situation and organization’s security policies). If the issue ceases upon the security plugin’s deactivation, then you know the security plugin caused the bug. 
  • Whitelist your IP, whitelist the URL path that triggered the block, or whitelist the “action” that caused the block

That’s a wrap! I hope this post helps you debug many of your WordPress problems!

Walter Miely is a tech entrepreneur and CEO of Phoenix Ignited Tech You can find him on Linkedin. This material is licensed under the CC BY 4.0 License LEGAL DISCLAIMER: The content provided here is provided AS IS, and part of, or the entirety of this content may be incorrect. Please read the entireLegal Disclaimer here.