WordPress Critical Error or White Screen of Death: How to Fix it
If, when attempting to access any given page on your website, you get a blank white screen, you’re in the right place!
- You may see a line or two of text describing an error.
- If you’re using WordPress 5.2+ instead of a white screen, you will likely instead receive an error like “The site is experiencing technical difficulties.“
- Using WordPress you receive an error like “there has been a critical error on your website.“
This indicates that there’s an error with the code that runs your site or (more likely) parts of your site. It could be due to any number of things, but the most common are:
- The result of an update for either your web app (like WordPress), a plugin, or theme that contains an error in the code
- Having your site configured to use a version of PHP (either newer or older) that the code that runs your site isn’t compatible with.
This means that there are a few possible quick solutions you can try, but if they don’t do the trick, then you’ll need to find the real error as described below.
Prefer we do the troubleshooting for you? Make your hosting plan’s Support Level either “Managed Troubleshooting” or “Hands-On Support” and you can ask us to take care of issues like this for you!
Possible Quick Solutions
Only if you use the Avada theme: and you’re using a caching plugin that enables minification (like WP Rocket or Autoptimize) and you’re experiencing a blank white screen, first try disabling minification entirely (HTML, Javascript, and CSS). This is likely to fix the issue.
PHP Version Too Old: if you’re using a version of PHP that is too old then WordPress, a plugin, or your theme may have updated automatically and is no longer compatible with that version of PHP. Try switching to the next highest version of PHP that is not marked “outdated” in Plesk. For example at the time of writing PHP 8.0 is likely the most stable option for most software, though this will surely be upped to version 8.1 soon.
PHP Version Too New: if you’re using a version of PHP that is too new then you may have an older plugin or theme that hasn’t been updated in a while and its code is not compatible. The best solution is to update the plugin or theme or replace it with one that is compatible with the latest PHP versions. (Another option is to reduce the PHP version to one that is compatible with the code, but this is strongly discouraged).
Memory Limit Exceeded: if you’re using a plugin or theme that isn’t great at keeping its memory in check, or requires a ton of elements on the page at one time, then it probably requires more memory. Just keep in mind that this software may not be well optimized in general which means it *could* slow down your site. And so, if after increasing the memory for the site you also notice it’s running slower, this plugin is likely the reason.
How to change the PHP version or a PHP configuration value, like memory limit, in Plesk
How to find the error
The blank white screen or vague error is just the visible output of the actual underlying error. If you do not see a specific error on the screen, this is because your web app (like WordPress) is suppressing the error. This can be a good thing for security, but it does make troubleshooting just a touch more difficult as you’ll need to access your site’s logs to find the error message.
Use our guide to learn how to view and identify the correct log entry within Plesk. If you’re using cPanel, you’ll probably have to ask your host to provide the logs.
Once you have associated the white screen of death with the correct error from the logs using the steps described in the above-linked guide, look closely at the error to determine the file path where the problem lies. Here’s an example of a file path you will see in the logs:
/var/www/vhosts/<your_domain>/httpdocs/wp-content/plugins/wpseo/some_random_file_within_the_plugin.php
This means that the file referenced contains the code which is causing the error. In the example above, this would be the wpseo plugin in a WordPress install.
What to do if the error does not contain a path that references a plugin or your active theme
Here’s the top portion of such an error:
AH01071: Got error 'PHP message: PHP Fatal error: Uncaught TypeError: http_build_query(): Argument #1 ($data) must be of type array, string given in /var/www/vhosts/<domain>
/httpdocs/wp-includes/Requests/Transport/cURL.php:530
It’s important that you look closely through the entirety of the error to see if it references any files from a plugin or your theme. If it does, then the steps above will apply. If it does not, you can use the bold parts from the error to attempt to narrow down the issue. Here’s how:
- Use the Plesk File Manager to navigate to the wp-content folder for your WordPress install
- In the upper right hand corner of the File Manager you’ll find the search option. Select the option to search in content, not file names, and enter:
http_build_query($data
It’s important to note that you’ll need to adapt the search for your particular error; if the function isn’t called http_build_query
and/or the argument isn’t called $data
, then you’ll need to use the correct function name and variable name. You may also need to try searching with a space between the opening argument and variable name like: http_build_query( $data
The results will list every file within all plugins and themes with that precise function and parameter. If you have just one or two results within the same plugin folder or the same theme, then you’ve found your culprit: that plugin or theme.
If there are multiple results, the culprit is frequently found among the ones that show the oldest modified date – deactivate, update, or replace that plugin and/or theme to resolve the issue.
For example with the error above, the issue was found to be the installed version of WP Optimize Pro not being compatible with PHP 8.1; and we used this exact method to determine that.
How to resolve the problem
- If you’re using WordPress, learn how to solve this when the error is within a plugin or theme.
- If you’re using Joomla, this article might be of service.
- If you get an error that indicates simply: “No Input File Specified” try this solution out.
- If you’re using WordPress and detect some pretty shady looking code within the file that’s causing the problem, you likely need to clean up your hacked site.
If none of the above links helps you resolve the problem, please open a ticket, include the error that you found in the logs, and we’ll help point you in the right direction!
Posted in Advanced, Code, Tips and Tricks, Web Design, WordPress Plugins
About Websavers
Websavers provides web services like Canadian WordPress Hosting and VPS Hosting to customers all over the globe, from hometown Halifax, CA to Auckland, NZ.
If this article helped you, our web services surely will as well! We might just be the perfect fit for you.
Very good, helped me fix my issues with Wordfence.