Troubleshoot theme errors in WordPress
WordPress theme errors can result in error messages or blank white pages, which is commonly referred to as a white screen of death. You can use the steps below to diagnose potential WordPress theme errors.
Prepare your WordPress site for troubleshooting:
- You should always backup your site before performing any troubleshooting.
- Disable all plugins, especially any caching plugins.
- If your site uses wp_cache, you will need to disable WP_CACHE.
Look for a theme related error
- Enable WordPress debug mode.
- Visit your site and check to see if there is a PHP error.
- If there is a PHP error, check to see if the themes directory is in the file path. Below is an example:
Fatal error: Call to undefined function functionName() in /home/wp-content/themes/twentyeleven/functions.php on line 1
- If the file path contains themes, then this confirms the issue is with the theme, and you can move on to fixing the error.
- If the error is not visible on your website, then you will need to expose the error:
- Linux Error Logs (
cPanel / Web Hosting)
- Windows Detailed Errors (
Plesk / Web Hosting)
- Linux Error Logs (
- If the detailed errors or logs show a PHP error, then you can begin fixing it.
Determine if the error only occurs with your currently active theme
- Connect to your hosting with FTP to upload files.
- Navigate to the directory containing your WordPress site.
- Then open the wp-content/themes directory.
- Make note of the latest default theme that is installed.
Note: Default WordPress themes are named after the year they were released. For instance, the default theme that came out in 2017 is named twentyseventeen.
- Update your WordPress site to use a default theme in the database.
- Check your site. If the issue is no longer persisting, then you have successfully determined the issue is with your non-default theme.
- After confirming the problem is related to your WordPress theme, you can move on to fixing the problem.
- Use debug mode to fix a WordPress error.
- If you need any assistance with fixing a theme error our WordPress Premium Support team can do that for you.