Now you can use the WPML Widgets plugins to translate your widgets. It is free and easy to use, we provide a full tutorial on how to display different widgets per language with WPML Widgets.

WPML lets you translate widget titles and the body of text widgets. Sometimes, it’s not enough and you want to have completely different widgets for each language. I’ll show you how to do this using Widget Logic.

Widget Logic is a plugin that allows controlling where widgets display using PHP code. You can use it to specify where widgets are allowed, including which languages they will display in.

For example, supposing that I want to have different feeds in the widget area. There are different ways to do this, but I’ll show how it can be done using Widget Logic and language conditions.

Before we begin, download and activate Widget Logic:

Add multiple copies of the widget to the Widget Area

Each of these widgets will be active in only one language, so we need as many copies as the number of languages we have.

The order of these copies doesn’t matter, as only one will be active at any time.

Two RSS widgets, one per language

Add language conditions per widgets

Click to edit each of these widgets and add the language conditions to the Widget Logic field.

WPML’s language code

The logic that we add uses WPML’s language code constant – ICL_LANGUAGE_CODE (reference). For example, for English we add:


This condition tells Widget Code to display this widget only on English pages.

We repeat this for all the copies that we created.

The result – different widgets per language

You should expect to see the different widgets per language now.

English page German page

58 Responses to “How to Display Different Widgets Per Language”

  1. Antonina says:

    Ok i guess I solved.
    I added the widget twice to the same widget area, then I edited each one to make it display in each language. and it worked!! thanks! anyhow i still did not understand if the String Translation module work forthis issue, and i would like to know now! 🙂

  2. vladimirK-3 says:

    I dont have “Widget logic” on my widjets.
    The issue is that I can only select pages where to display it, only on one language
    So if have navigation menu En and its translated then only En alone will be displaeed for me. When I select English page from that menu Then only on the english page the widject will be displayed.

    So I have no tools (in case to Display widject on specific page) to set widjet on translated pages (menu items).

  3. vladimirK-3 says:

    add widget logic plugin. does not help with the string ICL_LANGUAGE_CODE == ‘sv’
    only can assign widget for one language menu item

  4. vladimirK-3 says:

    figured out. But its trisky. you should open page on desired language and then add widget and start specifing menu item and it will be displayed on the same language that page is opened now.

    • Amir says:

      I’m not sure that I completely understand your question. This blog post is pretty old and you can do better things today. WPML lets you control on which languages text widgets will appear. Besides this, any other widget will be translated anyway.

  5. nicod-4 says:


    I’ve just released a new plugin that allows you to select the language you want to show the widget on. This is done by a dropdown within every widget.

    My reason to create this plugin is because I cannot justify the risks with Widget Logic.

    I just wanted to share this with you; the plugin is called WPML Widgets and can be downloaded for free on WordPress.org: http://wordpress.org/plugins/wpml-widgets/

  6. Sorin says:

    Hello. I have a little problem whit wpml-widgets. I have set to display the metro slider widget only in en putting this code ICL_LANGUAGE_CODE == ‘en’ in Widget logic but the widget is displayed also in other language. I have Metro Rox theme.

    • Amir says:

      Have you tried to test for different conditions? I suggest to enter different conditions that are not related to WPML. For instance, you can use simple Boolean statements, like True and False. See if these conditions control the display of the widget. If not, you have a problem between Widget Logic and the theme. The theme author should look into it.

      If simple Boolean conditions work, but WPML’s language constants don’t work, there’s an issue between WPML and the theme (the theme’s code is running too early).

      Let’s see what you get.

    • Sorin says:

      I have a problem whit WPML. For example: I create a edge slider in italian language and I select this slider to show in a italian page, but the slider is not working. If I don’t select the id of the slider witch I want to see in the italian page the slider is working but I see all slides that I create for the italian language.The name of my theme is Jupiter.
      Please hepl me

    • Sorin says:

      Hello. Wpml is compatible with woocommerce plugin.I have some errors, for example: I put the settings for the woocommerce in italian language, I save them; when I go to put the settings for another language this settings are overwrite the settings for the italian languages.