WordPress Debugging

WordPress Debugging
2025-06-02
admin

If your WordPress site is acting strangely - showing errors, white screens, or broken features - debugging helps you find and fix the problem. This guide explains what debugging is, why it matters, and how to use it to solve common WordPress issues.

What Is WordPress Debugging?

Debugging is the process of identifying and fixing errors in your website's code. WordPress has built-in tools to help you:

  • See hidden PHP errors (instead of a blank white screen);
  • Log issues without visitors noticing;
  • Find plugin/theme conflicts.

When Should You Use Debugging?

Turn on debugging when:

  • Your site shows a "white screen of death";
  • A plugin/theme update breaks your site;
  • You see PHP warnings like "Warning: Undefined variable";
  • Admin dashboard behaves strangely.

How to Enable WordPress Debugging

Enable Basic Debugging (wp-config.php);

Connect to your site via FTP (FileZilla) or hosting file manager;

Open "wp-config.php" (in your root WordPress folder).

wordpress debugging config file

Find this line:

define( 'WP_DEBUG', false )

Replace it with:

define( 'WP_DEBUG', true ); // Enable debugging

define( 'WP_DEBUG_LOG', true ); // Log errors to /wp-content/debug.log

define( 'WP_DEBUG_DISPLAY', false ); // Hide errors from visitors

wordpress debugging config change

Save the file.

Now, errors will be saved in "wp-content/debug.log" (instead of showing publicly).

Debug with a Plugin (For Beginners)

If editing files sounds scary, use:

wordpress debugging plugin WP Debugging wordpress debugging query monitor Query Monitor

Steps for WP Debugging Plugin:

  • Install & activate the plugin.
  • Go to Tools → WP Debugging.
  • wordpress debugging tools wp debugging
  • Toggle "Enable Debugging".

Advanced Debugging (For Developers)

For deeper troubleshooting, add to "wp-config.php":

Log database queries (slow performance)

define( 'SAVEQUERIES', true );

Then check queries with:

Add this to footer.php temporarily

if ( current_user_can( 'administrator' ) ) {
global $wpdb;
print_r( $wpdb->queries ); }

Best Practices for Debugging

  • Backup your site first (use UpdraftPlus);
  • Test on a staging site before debugging live;
  • Disable plugins one by one to find conflicts;
  • Check debug.log (in `/wp-content/`) for clues.

When to Turn Debugging OFF

After fixing errors, disable debugging by setting:

define( 'WP_DEBUG', false );

Leaving it on can:

  • Slow down your site;
  • Expose sensitive info to hackers.

Debugging helps you find hidden WordPress errors and fix them before they hurt your site. Start with WP_DEBUG in wp-config.php, then use plugins like Query Monitor for deeper checks.

Other Worpress Articles that may be interesting for you: