← Back to WordPress

Debugging WordPress Errors

WordPress errors can range from blank pages to database connection failures. This guide covers how to enable debugging, read error logs, and systematically identify the cause.

Enabling WordPress Debug Mode

Edit wp-config.php and add/update:

define('WP_DEBUG', true);\ndefine('WP_DEBUG_LOG', true);\ndefine('WP_DEBUG_DISPLAY', false);

Errors are written to wp-content/debug.log without displaying on the public site.

Common Error Types

  • Error establishing a database connection β€” wrong credentials in wp-config.php or MySQL service down
  • The site is experiencing technical difficulties β€” PHP fatal error; check debug.log
  • Parse error / syntax error β€” typo in a PHP file; identify the file in the error and fix or restore
  • Memory exhausted β€” increase WP_MEMORY_LIMIT in wp-config.php

Using Query Monitor Plugin

Install Query Monitor for a developer toolbar showing database queries, hooks, HTTP requests, and PHP errors on the current page. It's invaluable for finding slow queries and plugin conflicts.

Isolating the Problem

If you can't pinpoint the issue, systematically: (1) disable all plugins, (2) switch to a default theme, (3) re-enable plugins one by one. The error reappearing after enabling a specific plugin/theme identifies the culprit.

Was this article helpful?

On This Page