WordPress Development

Debugging WordPress

By Admin November 24, 2025

Debugging in WordPress is an essential process for identifying and fixing errors, issues, or unexpected behavior on your site. WordPress has a built-in debugging feature that allows developers and site admins to log errors, display PHP notices, and troubleshoot issues efficiently.

Enable Debugging in WordPress

To enable debugging, you need to modify the wp-config.php file located in the root directory of your WordPress installation.

Step 1: Open the Config File

Terminal
nano wp-config.php

Step 2: Add the Debug Code

Look for the line that says /* That's all, stop editing! Happy blogging. */. Just before that line, add the following:

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

Once saved, refresh your website. You should now see specific error messages instead of a generic "Critical Error" screen.

Common Debugging Tips

A. Disable All Plugins

  • Rename the plugins folder to something like plugins_old via FTP or SSH to deactivate all plugins instantly.
  • If the site works without plugins, reactivate them one by one to identify the culprit.

B. Switch to Default Theme

If the issue is theme-related, switch to a default theme like Twenty Twenty-Four.

  • Dashboard: Go to Appearance > Themes and activate a default theme.
  • FTP/SSH: Navigate to wp-content/themes and rename your current theme's folder. WordPress will automatically fall back to the default.
Guide verified by Admin