Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 8:00 – 17:00 -
- - - - - - -

Supporter timezone: Europe/Madrid (GMT+01:00)

Tagged: 

This topic contains 9 replies, has 0 voices.

Last updated by Paola Mendiburu 6 hours, 35 minutes ago.

Assisted by: Paola Mendiburu.

Author Posts
February 19, 2026 at 10:24 am

Daniel Dorado

Hi WPML Support,

Since updating WPML yesterday to v4.9.0, I’m seeing a redirect issue that breaks the Bricks editor only for the default language when the option “Use directory for default language” is enabled.

Setup

Default language: Spanish (es)

Secondary language: English (en)

WPML setting enabled: Use directory for default language

Builder: Bricks (using ?bricks=run/)

Issue

When I open a Spanish (default language) URL with Bricks editor:

hidden link

it redirects to:

hidden link

That extra /en/ prefix makes the builder not loading correctly showing a 404 error

What works

English URLs work fine (no wrong redirect).

If I disable “Use directory for default language”, the Spanish URL loads the Bricks builder correctly.

Expected behavior

The Spanish builder URL should load without being redirected to an URL containing /en/es/.

Request

Could you confirm if this is a known issue in WPML 4.9.0, and advise on the correct fix or workaround?

February 19, 2026 at 1:31 pm #17836194

Daniel Dorado

Hola,

He podido resolver el problema restaurando el backup a otro sitio dentro del multisite y haciendo un mapping del dominio a este nuevo sitio.

February 19, 2026 at 3:10 pm #17836521

Paola Mendiburu
WPML Supporter since 11/2020

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Madrid (GMT+01:00)

Me alegro.

No dudes en contactarnos nuevamente si tienes cualquier problema.

February 19, 2026 at 6:38 pm #17836961

Daniel Dorado

He podido replicar el problema, aparentemente si importo los settings del theme del sitio con problemas al nuevo, el problema reaparece, si restauro a los settings por defecto el problema desaparece

February 20, 2026 at 9:21 am #17837764

Paola Mendiburu
WPML Supporter since 11/2020

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Madrid (GMT+01:00)

Hola!

¿Sabrías decirme el setting concreto que es?

De esta manera puedo replicarlo en este sitio y pasarlo al equipo de compatibilidad: hidden link

February 20, 2026 at 5:21 pm #17839212

Daniel Dorado

La opcion BUILDER -> SITE LANGUAGE

"builderLocale": "en_US", -> esto en el JSON es lo que esta generando la incompatibilidad, probablemente debido a que "ES" es el idioma predeterminado del sitio el cual no es EN y como EN es un idioma que tambien esta activo quizas ahi es donde se esta formando el lio

Seteando la opción a SITE DEFAULT, soluciona el problema

"builderLocale": "site-default",

Screenshot 2026-02-20 at 12.18.59.png
February 23, 2026 at 2:37 pm #17843565

Paola Mendiburu
WPML Supporter since 11/2020

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Madrid (GMT+01:00)

Lo he puesto asi en el sitio local pero me funciona correctamente.

February 24, 2026 at 5:13 am #17844769

Daniel Dorado

Quizas porque tu instalación de wordpress orignal estaba en otro idioma, el multisite...

Prueba a montarlo en un multisite, instalación original en ingles, luego español y juega con los idiomas definidos por usuario y el setting.

Entiendo que en algun momento deberia de fallar

February 24, 2026 at 8:59 am #17845195

Paola Mendiburu
WPML Supporter since 11/2020

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Madrid (GMT+01:00)

Ok, gracias.

He podido reproducir el problema en el sitio de pruebas.

Lo he pasado al equipo de compatibilidad donde les he dado todas las indicaciones.

Te aviso en cuanto tenga noticias.

February 26, 2026 at 8:23 am #17855292

Paola Mendiburu
WPML Supporter since 11/2020

Languages: English (English ) Spanish (Español ) Italian (Italiano )

Timezone: Europe/Madrid (GMT+01:00)

Hola!

Ya he tenido respuesta del equipo de compatibilidad:

El conflicto no está directamente en WPML, sino en cómo Bricks gestiona el idioma del builder.

La solución más segura y sencilla es:

- Ir a Bricks → Settings → Builder
- Configurar el idioma como “Site Default” (Por defecto del sitio)

Alternativa técnica (solo si fuera necesario)

Existe un snippet que evita que Bricks fuerce el cambio de idioma y separa correctamente:
- añade este código en el functions.php del tema:

add_action( 'after_setup_theme', function () {
	if ( ! defined( 'ICL_SITEPRESS_VERSION' ) || ! class_exists( '\Bricks\Theme' ) ) {
		return;
	}

	$bricks = \Bricks\Theme::instance();

	// 1. Prevent Bricks from switching language
	if ( ! empty( $bricks->wpml ) ) {
		remove_action( 'bricks/builder/switch_locale', [ $bricks->wpml, 'switch_builder_languge' ] );
	}

	// 2. Instead switch UI locale
	add_action( 'bricks/builder/switch_locale', function ( $locale ) {
		if ( empty( $locale ) || empty( $_GET['bricks'] ) || $_GET['bricks'] !== 'run' ) {
			return;
		}

		// prevent memory exhausion I got on my sandbox
		static $lock = false;
		if ( $lock ) {
			return;
		}
		$lock = true;

		try {
			// Switch UI locale
			switch_to_locale( $locale );
			// Reload Bricks theme textdomain 
			unload_textdomain( 'bricks' );
			load_theme_textdomain( 'bricks', get_template_directory() . '/languages' );
		} finally {
			$lock = false;
		}

	}, 5, 1 );

}, 20 );