Error display in WordPress is disabled by default so that users don't see anything unnecessary.
Factors that can cause a white screen of death in WordPress:
- WordPress update and an error appeared;
- install or update the plugin;
- Setting or updating a template;
- Problem with the page cache.
Now that we know the cause of the problem, let's take a closer look at how to get out of this situation.
How to fix a white screen in WordPress
You need FTP access to the server hosting the site, but if you don't have it, a file manager is sufficient.
Error display mode
Go to the root of the site, open the wp-config.php file, and change the string:
to this one:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
define( 'WP_DEBUG_LOG', true );
An error will appear instead of the white screen. If the log does not appear, write: site/wp-content/debug.log
Now you can see what is causing the WordPress white screen.
Disable the plugin
If you see that the error occurs due to a plugin, go to the root of the site /www/wwwroot/domain/wp-content/plugins and disable this plugin by adding 1 to the name from the beginning. If everything is done correctly, the site should open.
Error in the subject
I recommend rolling back the site's backup.
If this is not possible, rename the current theme folder, WordPress will automatically start using the default template.
Try the following settings on the server (helps with updating and installing the template):
php version 7.4
max_execution_time = 600
max_input_vars = 6000
memory_limit = 512M
post_max_size = 512M
upload_max_filesize = 512M
Clean the cache
Caching can also cause such problems. However, if you are using a caching plugin, disabling the plugin via ftp will solve the problem.
The site must have rights:
- Files - 644
- Folders - 755
- wp-config.php - 400 or 440
You can set stronger restrictions:
- Root folder - /site.com/public_html/ - 750
- .htaccess - /site.com/public_html/.htaccess - 640
- wp-admin/ - /site.com/public_html/wp-admin - 750
- wp-admin/js/ - /site.com/public_html/wp-admin/js/ - 750
- wp-admin/index.php - /site.com/public_html/wp-admin/index.php - 640
- wp-content/ - /site.com/public_html/wp-content - 750
- wp-content/themes/ - /site.com/public_html/wp-content/themes - 750
- wp-content/plugins/ - /site.com/public_html/wp-content/plugins - 750
- wp-includes/ - /site.com/public_html/wp-includes - 750
If this was the problem, it has been resolved. Also check if selinux is enabled. This is an additional permission system that can cause problems.
The server may have limitations and not have enough RAM or execution time to render the page. To increase the amount of available memory, add the following directive to wp-config.