We’re planning to release WPML 4.8 in about 3 months. In this upcoming version, we’ll remove support for using Twig templates to customize language and currency switchers.
What This Means for You
This change only affects you if your website is currently using Twig templates to create fully customized language or currency switchers.
If you’re styling WPML’s standard language or currency switchers using methods like CSS, custom flags, or other regular options, this change doesn’t affect you. Everything will continue to work exactly as before.
Why We Are Making This Change
Very few websites actually use Twig templates to customize their WPML switchers. By removing Twig support, we’re making WPML more secure and streamlined. This also allows us to improve and maintain it more efficiently.
What You Should Do Next
If your site currently uses Twig templates for your language or currency switchers, please contact our support team soon. Our supporters are specially trained and ready to guide you through migrating to a PHP-based switcher solution.
If you’re not sure whether your site is using Twig templates, ask your website developer. They should know whether your site uses Twig or not.
We’re announcing this change 3 months in advance to ensure you have plenty of time to adjust.
To learn how to create your own switcher using PHP and CSS, check out our documentation page on custom language switchers.
Questions or Concerns?
Please let us know in the comments below if you have any questions regarding this change. We’re here to make sure your transition goes smoothly!
Dear WPML Team,
To be transparent, our website was originally developed by an agency with which we are no longer working.
Here is our website: [insert website URL].
We would appreciate it if you could take a look and let us know whether Twig is being used. If that is the case, could you please assist us with the upcoming transition?
Sincerely,
Bahruz
Hi Bahruz! We can definitely help you check whether Twig is being used on your site but please, create a ticket for this in our support forum, here: https://wpml.org/forums/forum/english-support/
Thank you!
So what was the point of introducing them in the first place?
Hi Pipo, that’s a great question! We introduced Twig some years ago to allow developers to easily build fully custom language and currency switchers. Instead of coding everything in PHP, Twig allows you to work with a much simpler syntax. Also, at the time, Twig was a popular and widely adopted templating engine, particulary in WordPress and PHP ecosystems. However, today, we see that actual adoption is very low, plus, if not used correctly by website developers, Twig can be a source of potential security issues. This is why we decided to retire it and as explained in the post, the vast majority of website don’t even use Twig language/currency switchers so most won’t ever notice this change at all.
I have built and set my website by myself and don’t know if I used it.
Aurora
Hi Aurora! I would say that if you don’t know, you probably didn’t use it. 🙂 However, this is why our Support Team will be more than happy to help you check this for you. Feel free to create a ticket in our support and our supporters will be happy to help with this!
Hi!
I definitely used it. What can I do to avoid losing my customizations?
Hi Benedetto! The best thing would be to open a ticket in our support and show our supporters your site and language switcher you created using Twig templates. They can then help you turn them into pure PHP switchers while retaining the same look and functionality.
If we get all our data for a custom switcher via PHP and output that via our own twig files are we affected?
Hi! Yes, I believe the Twig support drop will affect your site as well. Please, to be sure, create a ticket in our support and let our team take a look. Thank you!
Can you tell me if our website has twig templates enabled please?
Hi, Craig! As I wrote in the email, if you’re not sure, please contact our support and our team will help you check your site and confirm whether it’s using Twig templates or not. Thank you!
Easily discover if your site uses Twig. Here are two primary ways to discover if your WP site is using Twig:
Plugins
Look to see if the Timber plugin is installed.
Themes
Search the currently active theme directory for files with the .twig extension.
Hope this helps.
Hi, Michael! Thank you for sharing, but I’m afraid it’s not that simple. For example, the Timber plugin is used to build themes using Twig, however, WPML is dropping support for Twig in language switchers and currency switchers. It is not related to Timber or any other plugin using Twig templates.
While searching the currently active theme directory for files with the .twig extension is useful, it doesn’t cover all possibilities. This is because one can also add custom Twig language and currency switchers in other ways, for example, using a custom-built plugin.
In other words, it’s better to reach out to our support if you’re not sure whether your site uses Twig language and currency switchers or not.
Hello Dario,
is it correkt to assume, that my website won’t use any twig template if I just build my website with toolset and elementor PRO?
Also, by this occassion please let me ask can you provide me the guiding link you have had a few years ago for WPML and how to connect the maindomain including network subdomains plus additional domain subdomains in order to avoid multiple translation accross all domains? That would be indeed really awesome. Thank you.
Hi Beate! If you used Toolset and Elementor PRO and didn’t create your language and/or currency switchers using custom code, you most probably don’t use Twig.
About your other question, if I understood it correctly, this should be the documentation page you are looking for:
– https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/how-to-use-wpml-with-different-domains-per-language/
Hello, will the WooCommerce Multilingual & Multicurrency with WPML plugin be affected with this change?
Hi Wayne! If your WooCommerce store uses a language switcher that was built with Twig templates, then yes, it will be affected.