Fix theme errors in WordPress
After troubleshooting your site to determine the error, you can attempt to fix your theme and return your site to a working state.
Understanding a WordPress related PHP error
If your previous troubleshooting revealed a PHP error, use the following table to help understand the error.
Error type | Definition and Next Steps |
---|---|
E_ERROR | This is a fatal error that causes script termination. These typically are caused by calling a non-existing object like a class or function. This can often occur in version incompatibility. Your next steps should be to update your WordPress version, themes, and plugins. |
E_WARNING | A run-time warning does not cause script termination. These are potential issues that occur but do not stop the processing of PHP. These can often include deprecation warnings, which indicates that your code may be using an outdated version of PHP and needs to be updated. A warning in your PHP logs may not necessarily be related to the issue you are experiencing. |
E_PARSE | This is a compile time parse error. It is usually indicative of a PHP syntax error, such as a missing semicolon ;, parenthesis (), or opening or closing bracket {}, or any number of other syntax errors. You should review the file and line specified in the error message and look for potential syntax error. |
E_NOTICE | These are typically PHP errors that don't cause script termination. They indicate that there could be an issue, but may be part of the normal running of the script. A common cause is using a PHP variable that is undefined. A notice in your PHP logs may not necessarily be related to the issue you are experiencing. |
Update your WordPress components
When your WordPress version, theme, or plugins are updated, they may develop a conflict with the other components that have not been updated. Updating the other components can restore your site. See the following to update a component of your site:
- WordPress core
- Theme
- Plugins
- PHP version (
cPanel / Plesk / Web Hosting )
White screen with no PHP error
If you have a white screen of death, and your troubleshooting did not reveal a PHP error, then check the following:
- Make sure your wp-content/themes directory is present.
- Confirm the permissions are correct for the wp-content and themes directories.
- 755 for Linux accounts (
cPanel / Web Hosting ) - Read and Write for Windows accounts (
Plesk / Web Hosting )
- 755 for Linux accounts (
- Confirm the directory for your active theme also has the correct permissions.
- Make sure the directory for your active theme has files present in it.
- Check to see if there is a default theme also present in the wp-content/themes directory. WordPress will automatically load the default theme in the event the active theme is not present.
- Confirm the index.php file in the root directory is not missing or blank.
- Confirm your theme's index.php file is not missing or blank.
Next steps
- If the issue persists after the above troubleshooting, then you may need to uninstall and reinstall your theme.