Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client is preparing for the launch of their site and during WCAG testing, discovered that the language selector does not contain aria-labels or titles. Despite these attributes being set in the Twig templates for both legacy dropdown and legacy dropdown on click, they are not present in the rendered markup.
Solution:
We recommend converting the custom language switcher from a .twig template to a PHP-based implementation, as Twig will be removed entirely from WPML in future releases. Regarding the missing aria-labels, this issue has been reported to our development team, and it will be improved. However, we cannot guarantee a specific timeline for this fix.

Please note that this solution might be outdated or not applicable to your particular case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

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.

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by restekC 5 months ago.

Assisted by: Andrey.

Author Posts
November 26, 2025 at 9:23 pm #17613367

restekC

Background of the issue:
I am preparing for the launch of our site and running it through WCAG testing. The language selector does not contain aria-labels or titles. We are on the latest version of the plugin and have reviewed the plugin code, which shows both aria-label and title are set in the Twig templates for both legacy dropdown and legacy dropdown on click. However, neither aria-label nor title make it into the rendered markup for the language selector. The issue can be seen at: hidden link.

Symptoms:
Aria-labels and titles are not present in the rendered markup for the WPML language selector.

Questions:
Why are the aria-label and title attributes not rendering in the final markup for the language selector?
How can I ensure that aria-labels and titles appear in the rendered markup?

November 26, 2025 at 11:39 pm #17613587

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

Starting from WPML 4.8, support for Twig templates used to customize language and currency switchers has been removed.

For reference, please see the official announcement:
https://wpml.org/changelog/2025/05/wpml-4-8-will-drop-support-for-twig-templates/

If you want to create a custom language switcher, you can now do so with PHP and CSS. You can follow our detailed guide here:
https://wpml.org/documentation/getting-started-guide/language-setup/language-switcher-options/custom-language-switcher/

November 29, 2025 at 4:15 pm #17619771

restekC

Thank you for the informative response. We're using the WPML Language Switcher component (header/menu). You're advising that the twig templates which are still present in the current code are no longer utilized by the code? Can you advise if WPML has addressed the long outstanding issue of aria-labels and/or title attributes on language links in the OOTB WPML Language Switcher component? Or, after paying for the WPML product, we now have an additional spend for development of a WCAG compliant language switcher?

December 1, 2025 at 10:22 am #17622019

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

Twig will be removed entirely from WPML in future releases, so I strongly recommend converting your custom language switcher from a .twig template to a PHP-based implementation.

Regarding the aria-label issue: it has already been reported to our development team and is under consideration for a near-future fix. However, I cannot guarantee when — or if — it will be implemented, as it depends on priorities and other ongoing development tasks.

December 3, 2025 at 2:09 pm #17631184

restekC

Thank you, Andrey.

Clarifying my previous comments, we are NOT using a custom language switcher. We are using the out-of-the-box language switcher, provided by WPML, with NO modifications.

Your response indicates the WPML product does NOT support WCAG compliance, and we will in fact need to develop our own language switcher for WCAG compliance. This is unfortunate that WPML has not previously addressed this, especially since adding aria labels is such an insignificant lift from a development perspective.

Thank you. This ticket can be closed.