WordPress Development

A complete guide to
Debugging WordPress

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

Disable All Plugins

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

Default Theme

  • Dashboard: Go to Appearance > Themes and activate a default theme.
  • FTP/SSH: Rename your current theme's folder in wp-content/themes.
Guide verified by Admin