Skip Navigation


Overview of the issue

Languages switcher will ignore wpml-config.xml settings.


Fix will be released with WPML 3.1.8. For the time being, you can add this snippet in your theme functions.php:

function temp_init() {
	$iteration = 1;
	if ( ! is_admin() ) {
	$temp_init_done = get_transient( 'temp_init_done' );
	if ( $iteration !== (int)$temp_init_done ) {
		icl_set_setting( 'language_selector_initialized', false );
		set_transient( 'temp_init_done', $iteration );
add_action( 'init', 'temp_init' );

This code will run only once (or as long as the transient exists).
If you need to parse again the xml file, increase the value of the $iteration variable.

Once WPML 3.1.8 is released, it is recommended to remove this code.