Skip Navigation
18

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!

18 Responses to “WPML 4.8 Will Drop Support for Twig Templates in Custom Switchers”

  1. 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 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.

    • 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 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.

    • 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!

  2. 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.

  3. 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 Wayne! If your WooCommerce store uses a language switcher that was built with Twig templates, then yes, it will be affected.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>