The White Screen of Death (WSOD) is one of the most common issues in WordPress.
It can be frustrating, but it can generally be resolved by following these guide:
Before making any changes, it’s important to ensure you have a backup of your website. You can use a backup plugin like UpdraftPlus or your preferred one, or do it manually through cPanel.
Enable WordPress Debugging
Debugging will help you identify the exact error causing the white screen. Open the wp-config.php file in the root directory of your site and add the following lines just before /* That’s all, stop editing! */:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false);
This will enable debugging and save error logs to a debug.log file in the /wp-content/ folder. Now, reload your site, and you’ll be able to observe the errors that led to the white screen. Below are example errors:
Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes) in /path/to/file.php on on line 89
Fatal error: Call to undefined function function_name() in /path/to/file.php on line 51
Increase the memory limit
If, after enabling WordPress debug mode, you encounter the error ‘Fatal error: Allowed memory size of X bytes exhausted’, it is because your site has exhausted or reached the allocated memory limit. You will need to allocate more memory to the application.
This can be done through the wp-config.php file in many WordPress installations. Open the file and add the following code:
Check Your Plugins
Plugins are often the cause of the white screen. To check if a plugin is causing the issue, follow these steps:
1. Go to the /wp-content/plugins/ directory.
2. Rename the folder of the plugin you suspect is causing the problem. For example, you can change ‘plugin-name‘ to ‘plugin-name-disabled‘.
3. Try accessing your website again. If the white screen disappears, you’ll know that particular plugin was the cause.
Check Your WordPress Theme
If disabling plugins doesn’t solve the problem, it’s possible that the theme is the culprit. Follow these steps to check it:
1. Go to the /wp-content/themes/ directory.
2. Rename the folder of the active theme. For example, you can change ‘theme-name‘ to ‘theme-name-disabled‘.
3. Try accessing your website again. If the white screen disappears, the theme was the issue.
Note: It’s always recommended to keep WordPress themes and plugins updated to their latest versions as this helps prevent the white screen error and maintains website security, making it less vulnerable to infections and security breaches.
Check File Permission Issues
Another possible cause of the white screen is file and folder permissions.
In this case, access the file manager and verify that they have the following permissions:
- Folders – 755
- Files – 644
If the main files or folders of the site do not have these permissions, assign the correct ones.
Contact Your Hosting Provider or Developer
If you still have the white screen after following these steps, it’s possible that the problem is more complex and may require assistance from your hosting provider or developer.