Enable Error Log reporting in WordPress

Debugging With WP_DEBUG

The most important debugging tool you need to know about is WP_DEBUG.

WP_DEBUG is a boolean constant, which triggers the “debug” mode throughout WordPress. It’s found in the wp-config.php file in your WordPress install.

When set to “true,” you’ll start seeing PHP notices – not so much errors as they are helpful messages for developers – and WordPress-generated debug messages, particularly deprecated function usage, displayed on your site’s pages.

Deprecated functions, which are contained in many WordPress releases, are functions that have been flagged to die at a later date. It’s important to know if you are using a deprecated function in a theme or plugin you’re working on so you can find a replacement to use instead.

To turn on WP_DEBUG, find the following line of code to your wp-config.phpfile:

  define( 'WP_DEBUG', false );

Then, replace false with true and save the file.

To turn the constant off, just replace “true” with “false”. WP_DEBUG is set to false by default.

WP_DEBUG provides a handy way to troubleshoot problems when something goes wrong with your site.

It’s important to keep in mind that WP_DEBUG should not be used on a live site. While it’s a useful feature during development, it can be dangerous on a live site because text in the PHP notices can reveal details about your code, paths and other information to visitors to your site.

  • 489 Users Found This Useful
Was this answer helpful?

Related Articles

 wordpress blank pages

This article discusses what to do when WordPress displays a blank page, aka "white screen of...

 migrating a wordpress site from subdirectory to root directory

Before migrating WordPress from subdirectory to root directory 1. Be sure you have access to...

 How to improve WordPress Security

Nowadays we face a lot of security issues with different content management systems (CMS) and web...

 editting php options

You can change the Php Options through c panel as follows 1. Login to c panel and search for PHP...

 essential plugins

Having many plugins on your WordPress site is not a good practice as they slow down your...