Auto switch only for HomePage

Since the version 3.5 of Weglot plugin, the auto redirection feature works on all pages. Here is how to restrict it to the homepage only

By default, auto switch will be on all pages. For example with a french browser:

/ will be redirected to /fr/ /contact will be redirected to /fr/contact

To restrict it only for home page:

// Add this using plugin "Code Snippet" or directly in functions.php
add_filter( 'weglot_autoredirect_only_home', '__return_true' );

Last updated