The following guide will show you how to debug WordPress issues such as:
- "White Screen of Death"
- Plugin and Theme issues
- Timeouts and unexpected behaviour
It is advised that you enable both WP_DEBUG and WP_DEBUG_LOG - and consult the "debug.log" file, to troubleshoot issues/errors effectively.
The typical troubleshooting process for WordPress is to enable Debugging and review any errors that are apparent during and after the task at hand; note that debugging is disabled by default (via WordPress) and as such you see only generic errors on screen when there are issues.
You can enable Debugging for your WordPress website by opening the wp-config.php file and finding the following line:
and changing it to:
After saving the changes, when you refresh/retry the page/task with the issue, the errors should then display on screen.
Logging Errors To File For Later Viewing
This is useful where errors are being triggered at sporadic times, being generated in the background and you cannot see them on screen or you do not wish to show the errors on the screen; note however there can be occasion where it is favourable to show the errors on screen - to make troubleshooting easier.
If you wish to log the errors to a file instead of displaying them on screen, you can add the following lines to the wp-config.php file on a new line under
To view the debug log, you would need to download the following file via FTP:
It should be noted that more often than not, you will need to enable
WP_DEBUG_LOG to see the full set of errors being generated; this is REQUIRED within WINDOWS hosting environments.
You must insert the lines listed above, BEFORE the following line in the wp-config.php file:
/* That's all, stop editing! Happy blogging. */
The information above is taken from a codex page, provided by the creators of Wordpress: if you wish to know more about the process behind the directives above please review the source codex: Debugging_in_WordPress.
If you have any queries regarding to the above, please contact email@example.com