Site Overlay

Disable the Elementor Theme Builder programmatically

If for any reason you see yourself in the need to deactivate the Elementor Theme Builder, you can use the following snippet:

add_action( 'wp_loaded', 'remove_elementor_register_conditions', 1 ); // Hook with priority 1

function remove_elementor_register_conditions() {

    // Get Elementor Pro's Module instance.
    $theme_builder_module = \ElementorPro\Modules\ThemeBuilder\Module::instance();

    // Access Conditions Manager.
    $conditions_manager = $theme_builder_module->get_conditions_manager();

    // Check if not null.
    if ( $conditions_manager ) {
        remove_action( 'wp_loaded', [ $conditions_manager, 'register_conditions' ] ); // Unhook the register_conditions() method from the Theme Builder module.
}

Leave a Reply

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