If you accidentally introduce a syntax or fatal error in one of your template files, you’ll probably see the dreaded white screen of death when you visit your home page. In some cases, even the admin screens will go blank. The best way to figure out what happened is to check your PHP error log. Look for the last error shown and try to correct it. However, if you can’t find your error log (or you don’t have one), you can turn on debugging by adding define('WP_DEBUG', true);
to your wp-config.php
file.
The problem with this method, though, is that everyone who visits the site will see your errors. Joost de Valk offers this alternative, which lets you enter debug mode by adding a query string to any URL.
if ( isset($_GET['debug']) && $_GET['debug'] == 'debug') define('WP_DEBUG', true);
Then you can just add ?debug=debug
to your URL (e.g. http://mysite.com/category/news/?debug=debug
) to see the errors.
The white screen of death usually comes up when you update a theme or plugin. If your theme has gone horribly wrong and you just want to switch back to another one, but you can’t access the admin screens to change it, don’t panic. Simply delete or rename your active theme’s directory. When WordPress can’t find it, it will revert to the default theme. You can also deactivate an error-causing plugin by deleting or renaming its directory. WordPress will automatically deactivate it.
Find all the WordPress Hidden Gems in [link id=”2675″]Beginning WordPress 3[/link].
Andrea_R says
really?? How come I did not know this? :D this is awesome!
Mark Marshall says
A good reminder. I have used the rename theme troubleshooting step in the past, but those brain cells went away. Thanks for the tip again.
sychedelix says
Ohh!it’s interesting stuff :P