Skip Navigation

Open

Overview of the issue

WPML allows you to display WordPress widgets in all your site’s languages or only on specific languages using the Display on language dropdown menu.

However since WordPress 5.8, if you add a Custom HTML widget, it will be display on all languages regardless of your settings.

Workaround

As a workaround, click on the Widget’s menu and transform it to a Group block. Then you can select the language from the Display on language dropdown.

Displaying a custom HTML widget on specific languages
Displaying a custom HTML widget on specific languages

11 Responses to “WordPress 5.8 - Custom HTML widgets are displayed in all languages”

  1. I’ve noticed this issue and wanted to add that there is a JS Console error, which may be related to the issue.

    /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/tm/dist/js/ate-jobs-sync/app.js?ver=2.11.0

    Uncaught (in promise) ReferenceError: ajaxurl is not defined
    at app.js?ver=2.11.0:6
    at app.js?ver=2.11.0:6
    at app.js?ver=2.11.0:6
    at app.js?ver=2.11.0:6
    at app.js?ver=2.11.0:83
    at c (app.js?ver=2.11.0:35)
    at Generator._invoke (app.js?ver=2.11.0:35)
    at Generator.next (app.js?ver=2.11.0:35)
    at n (app.js?ver=2.11.0:6)
    at s (app.js?ver=2.11.0:6)

    I’m guessing someone just assumed the ajaxurl was going to be defined by a plugin in php, but it wasn’t and now it’s failing to make it’s own ajax calls and thus the language selector is having issue. I could be 100% wrong, and this could be unrelated but I feel it’s a good place to start debugging.

    • Hello!
      As far as I know, this variable is defined in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/tm/classes/ATE/Review/ReviewTranslation.php

      Now, if you have some unexpected issues with this, may I suggest that you open a ticket in our support forum, so that we can try to debug this further and possibly find a fix or at least a workaround for your case?

    • I have the same problem. Even though at the top of the page I have var ajaxurl = '/wp-admin/admin-ajax.php',, I get an error saying Uncaught (in promise) ReferenceError: ajaxurl is not defined, and widget language settings are not saved.

  2. I have the same issue. Even though I have var ajaxurl = '/wp-admin/admin-ajax.php', on the top of the page (widget admin), I get the error Uncaught (in promise) ReferenceError: ajaxurl is not defined when I try to save changes. Language settings of widgets are not saved.

    • Hello Alexander,
      According to your description it sounds like a different issue from the one reported here. Could you please open a ticket in our support forum where one of our supporters will be able to investigate it?
      Regards

    • Hello Paul,
      By the moment we don’t have any major updates here. If the workaround here provided does not work, could you please open a ticket in our support forum so we can investigate your case?
      Regards

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>