Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Complete Reference: WordPress Debugging & Troubleshooting Guide

Any wordpress issues and problem may be caused by a variety of issues, including:

  1. Bad theme
  2. Bad plugin
  3. Bad install/upgrade
  4. you exhausted the memory limit
  5. It could also mean that there is an issue with your web hosting server such a wrong PHP version, mysql version, Missing or wrong php extension.

Part – 1- Enable debugging mode in WordPress, follow the steps:

Edit wp-config.php and add following

define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_LOG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );

After reloading the website all WordPress debug errors will be written into the file debug.log which is located in the folder: wp-content/debug.log

If you want to see the debug log errors directly on the screen instead of having the need to look into the debug.log change WP_DEBUG_DISPLAY to define( ‘WP_DEBUG_DISPLAY’, true );

Part – 2: Change the location of the debug.log

You can change the location of written errors by changing the value of the constant WP_DEBUG_LOG from true to a path of your choice in wp-config.php like so:

define(‘WP_DEBUG_LOG’, ABSPATH . ‘/logs/errors.log’);

Part – 3: Allowed memory size of 41943040 bytes exhausted (tried to allocate issues
Edit the wp-config.php file on your WordPress site with following
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );

Part – 4: Go to Plugins Manager and Activate and Deactivate WordPress plugins and validate error status.

Part – 5: If you can install plugins, install “Health Check”: https://wordpress.org/plugins/health-check/ On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site. You can then use its admin bar menu to turn on/off plugins and themes one at a time.

Rajesh Kumar
Follow me