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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: America/Los_Angeles (GMT-07:00)

This topic contains 3 replies, has 0 voices.

Last updated by Bobby 4 days, 17 hours ago.

Assisted by: Bobby.

Author Posts
March 17, 2026 at 6:48 pm #17905813

joelR-19

The changes in version WPML 4.9 (we're now on 4.9.2) fixed a couple of the issues with accessibility in the custom language switcher but created a new one.

Accessibility checks using SiteImprove now identify an issue where the selector uses the generic text "Language switcher, press tab to navigate to other languages" as the aria-label where it should be the name of the specific option e.g. "English(Ingles)". The same is true of the title tag, which is slightly different than the option text but should match.

Here's the relevant code causing the issue:

<a lang class="js-wpml-ls-item-toggle wpml-ls-item-toggle" aria-current="page" aria-expanded="false" aria-controls="wpml-ls-submenu-default" aria-label="Language switcher, press tab to navigate to other languages" title="Switch to English (English)" href="#">
<span class="wpml-ls-native">English</span>
</a>

Also, it's not an accessibility issue but the new code leaves out a space between the Current language name and its translation e.g. "English(Ingles)"

Is there a workaround for this or is a fix on the roadmap?

Thanks,
Joel Risberg

March 19, 2026 at 6:22 pm #17912259

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Here is the full code from your site when viewing the source code.

<div
	 role="navigation" aria-label="Language Switcher" class="wpml-ls-statics-shortcode_actions wpml-ls wpml-ls-legacy-dropdown js-wpml-ls-legacy-dropdown">
	<ul>
		<li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-en wpml-ls-current-language wpml-ls-first-item wpml-ls-item-legacy-dropdown">
			<a href="#" hreflang="" lang="" class="js-wpml-ls-item-toggle wpml-ls-item-toggle" aria-current="page" aria-expanded="false" aria-controls="wpml-ls-submenu-default" aria-label="Language switcher, press tab to navigate to other languages" title="Switch to English (English)">
				<span class="wpml-ls-native">English</span></a>

			<ul id="wpml-ls-submenu-default" class="wpml-ls-sub-menu">
				
					<li class="wpml-ls-slot-shortcode_actions wpml-ls-item wpml-ls-item-es wpml-ls-last-item">
						<a href="<em><u>hidden link</u></em>" hreflang="es" lang="es" class="wpml-ls-link" aria-label="Switch to Spanish (Español)" title="Switch to Spanish (Español)">
							<span class="wpml-ls-native">Español</span><span class="wpml-ls-display"><span class="wpml-ls-bracket">(</span>Spanish<span class="wpml-ls-bracket">)</span></span></a>
					</li>

							</ul>

		</li>

	</ul>
</div>

Just to verify -- are you setting this custom via the theme or code?

When I inspect our switcher on WPML.org I can see it shows slightly different.

https://wpml.org/es/

<div class="footer_language_popover" aria-label="Language switcher"><button type="button" id="footer_language_popover_link" aria-expanded="false" aria-haspopup="true" aria-label="Current language: English. Click to change language"
March 31, 2026 at 6:11 pm #17941112

joelR-19

We're using this PHP code to call the custom language selector with only some visual CSS modifications to its colors and spacing:

<div class="LanguageSelector" style="display:inline;float:left;"><?php do_action('wpml_add_language_selector'); ?></div>

Is there something different we should be doing to make sure we're seeing the version with the improved aria tags like the wpml.org page you linked to?

April 1, 2026 at 9:11 pm #17944489

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

I would like to request temporary access (wp-admin and FTP) to your site to test the issue.
(preferably to a test site where the problem has been replicated if possible)

**Before we proceed It is necessary to take FULL BACKUP of your database and your website. Providing us with access, you agree that a backup has been taken **

I often use the Duplicator plugin for this purpose: http://wordpress.org/plugins/duplicator/
You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you enter is private which means only you and I have access to it.

NOTE: If access to the live site is not possible and the staging site does not exist please provide me with a duplicator package created with the duplicator plugin.

Thank you,
Bobby