Categories
WordPress

Debugging WordPress – First Step

You’ve navigated to a certain window at the wp-admin area of your website and your site displayed a blank page. It could have been almost any page (for example, you clicked on All Posts) and I am sure that lots of WordPress users experienced this problem at least once.

Before you contact your hosting provider or a friend who is a fellow WordPress user (and it turns out that he is your best friend at that moment 😀 ), there is also some troubleshooting you can do on your own.

Enter WP_DEBUG.  This is a constant inside the wp-config.php file (located at the root directory of your website) which is by default set to false. In some cases, it’s not even set there (it is assumed to be set to false) but in either situation, whenever you stumble across an error on your WordPress website, set it to true. Like this:

define( 'WP_DEBUG', true );

This will allow WordPress to display the exact error message instead of a blank page. It can also help you in a similar situation I described here.

After setting this constant to true, refresh the page where the blank screen was presented and you will see the PHP error and you will also see the exact number of the line of code which caused it. If the code is inside a plugin file, deactivate that plugin. If it’s not, look for answers on the web and check the Stackoverflow and WordPress Support Forum itself.

The awesome Gravatar of dakisha

By dakisha

WordPress enthusiast and Customer Happiness addict. Working for Automattic as a Happiness Engineer. Loves chess, tennis, and good food.

2 replies on “Debugging WordPress – First Step”

Leave a Reply to dakishaCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from My Two Cents

Subscribe now to keep reading and get access to the full archive.

Continue reading