How to fix live builder issue with Weglot

Compatibility issue with live theme builder

Weglot is not intended to translate backoffice elements. More and more site builders offer the live builder feature. Some of its live builders will come into conflict with Weglot because Weglot will attempt to translate elements that are not wanted at that time. To avoid this we will ask Weglot not to translate when we are in the live builder.

Let’s take the example of Avada theme builder. When we are in the live builder we have the get fb-edit variable in the url so we can use this snippet:

if(isset($_GET['fb-edit']) || isset($_GET['builder'])){
    add_filter( 'weglot_active_translation', '__return_false' );
}

Here another exemple with elementor : we use a hook instead of url parameters :

function weglot_deactivate_elementor() {
	add_filter( 'weglot_active_translation', '__return_false' );
}
add_action( 'elementor/init', 'weglot_deactivate_elementor' );

Last updated