Last updated on October 18, 2023

Elementor white screen of death fix

Don’t know where to add this snippet? Read our guide: How to add code snippets.

Fix the Elementor white screen issue efficiently.

The Elementor white screen of death is a common issue that can occur when using the Elementor page builder plugin on WordPress. This issue usually happens when there is a conflict with another plugin or theme, or when there is a memory limit exceeded. To fix this issue, you can try the following steps:

  1. Increase PHP Memory Limit: Add the following code to your wp-config.php file to increase the PHP memory limit.
define( 'WP_MEMORY_LIMIT', '256M' );
  1. Disable Plugins: Temporarily deactivate all other plugins except for Elementor and see if the issue is resolved. If it is, then you can activate the plugins one by one to identify the conflicting plugin.

  2. Switch to a Default Theme: Temporarily switch to a default WordPress theme like Twenty Twenty-One and see if the issue is resolved. If it is, then there might be a conflict with your current theme.

  3. Check Error Logs: Check the error logs on your server to see if there are any specific error messages related to the white screen of death issue. This can help identify the root cause of the problem.

  4. Reinstall Elementor: If none of the above steps work, you can try reinstalling the Elementor plugin. First, deactivate and delete the existing Elementor plugin, and then reinstall it from the WordPress plugin repository.

Here’s an example of how to increase the PHP memory limit in the wp-config.php file:

define( 'WP_MEMORY_LIMIT', '256M' );

This code snippet sets the PHP memory limit to 256 megabytes, which can help resolve memory-related issues that may cause the white screen of death in Elementor.

Remember to always backup your website before making any changes to the code or plugins.

Examples

Example #1: Disabling conflicting plugins

This use case demonstrates how to fix the Elementor white screen of death issue by disabling conflicting plugins.

function wpsnippets_disable_conflicting_plugins() {
    if ( is_admin() ) {
        return;
    }

    $conflicting_plugins = array( 'plugin1', 'plugin2' );

    foreach ( $conflicting_plugins as $plugin ) {
        if ( is_plugin_active( $plugin ) ) {
            deactivate_plugins( $plugin );
        }
    }
}
add_action( 'init', 'wpsnippets_disable_conflicting_plugins' );

The code above creates a custom function wpsnippets_disable_conflicting_plugins() that checks if the current page is in the admin area. If not, it deactivates the specified conflicting plugins (plugin1 and plugin2) using the deactivate_plugins() function. This helps to resolve the Elementor white screen of death issue caused by conflicting plugins.

Example #2: Increasing PHP memory limit

This use case demonstrates how to fix the Elementor white screen of death issue by increasing the PHP memory limit.

function wpsnippets_increase_memory_limit() {
    $current_limit = WP_MEMORY_LIMIT;

    if ( ! is_numeric( $current_limit ) ) {
        $current_limit = wp_convert_hr_to_bytes( $current_limit );
    }

    $new_limit = max( $current_limit, '256M' );

    if ( $new_limit > $current_limit ) {
        @ini_set( 'memory_limit', $new_limit );
    }
}
add_action( 'init', 'wpsnippets_increase_memory_limit' );

The code above creates a custom function wpsnippets_increase_memory_limit() that retrieves the current PHP memory limit using the WP_MEMORY_LIMIT constant. It then checks if the limit is numeric and converts it to bytes if necessary using the wp_convert_hr_to_bytes() function. The function sets a new memory limit of 256M if it is higher than the current limit using the ini_set() function. This helps to resolve the Elementor white screen of death issue caused by insufficient PHP memory.

Example #3: Enabling debug mode

This use case demonstrates how to fix the Elementor white screen of death issue by enabling debug mode.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

The code above sets three constants (WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY) in the wp-config.php file to enable debug mode. This helps to identify and troubleshoot any errors or warnings that may be causing the Elementor white screen of death issue. The debug log will be saved to the wp-content/debug.log file.

Last updated on October 18, 2023. Originally posted on January 5, 2024.

Leave a Reply

Your email address will not be published. Required fields are marked *