Developer advisory: Translation loading changes in WordPress 6.7


WordPress 6.7, which is likely to be released on November 12, 2024, changes the way translations are loaded, aligning with best practices for internationalization. This shift affects how and when translation strings should be triggered, aiming to prevent potential issues that arise from loading translations too early.

However, as the plugin ecosystem adjusts, you may encounter warning notices, particularly if you’re using the forthcoming WooCommerce 9.4 with WordPress 6.7.

These notices may look like this:

_load_textdomain_just_in_time was called incorrectly. Translation loading for the <PLUGIN> domain was triggered too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /srv/htdocs/wp-includes/functions.php on line 6087.

WooCommerce-Specific Context

In WooCommerce, we’ve proactively made changes in version 9.4 to address early translation loading in light of WordPress 6.7’s new practices. While these updates mitigate most issues, some users may still encounter debug notices under certain configurations, especially when WooCommerce is running alongside other plugins and extensions.

What You Can Do to Minimize Impact

For production sites, to avoid seeing these notices disrupt frontend functionality, we recommend setting WP_DEBUG_DISPLAY to false, unless you are actively troubleshooting another issue. This prevents notices from displaying and breaking some functionalities.

For troubleshooting or development environments where notices are filling logs, you might want to temporarily suppress these notices with the following snippet:

add_filter( 'doing_it_wrong_trigger_error', '__return_false' );

Monitoring and Future Updates

We’re actively monitoring support channels and will provide updates or maintenance releases if further mitigation is needed. If you encounter specific issues related to translation loading, don’t hesitate to reach out.

Thank you for your understanding and patience as we all adjust to these changes in WordPress 6.7.


Keep yourself in the loop!

This field is hidden when viewing the form
This field is hidden when viewing the form
This field is hidden when viewing the form


30 responses to “Developer advisory: Translation loading changes in WordPress 6.7”

  1. danielspain Avatar
    danielspain

    Hi, sadly the filter doesn’t work. I’ve tried with this problem(no offending plugin or them, just defaults) but the wordpress language set to spanish(you could try with any non-english,update traslations if any-and try the filter in your functions.php, it won’t work also), the notice will fill your logs…at an alarming rate in a medium traffic site? Could we try another solution please??????????????? Tried with wp 6.7rc5 and wc 9.4rc4…here my previous repot bug in wc github:

    https://github.com/woocommerce/woocommerce/issues/52646

    As i just said, the filter doesn’t work, perhaps another code snippet? Other plugins just corrected their code before, it could be really serious if every non-english wc sites flood their logs…thanks in advance!

    1. Barry Hughes Avatar
      Barry Hughes

      I’m unsure why the snippet isn’t working for you but, especially if you used a code snippet plugin, one possibility is that it is not being loaded early enough. If you haven’t already tried this, you may wish to move it into a mu-plugin instead.

      1. danielspain Avatar
        danielspain

        Sorry, with the bare code of the filter in functions.php didn’t work, with the code via code snippets plugin it worked; altough if we don’t upgrade from 9.3.3(to wait for 9.4.1 final) and upgrade to wp 6.7 the translations of wc don’t work anymore…and the php notice appears(could be mitigated by the code snippet)…thanks in advance!

        1. Barry Hughes Avatar
          Barry Hughes

          No need to be sorry! Please bear in mind however that your theme’s functions.php file (I think that’s what you mean?) is not the same as a plugin, or a mu-plugin.

          In any case: we’re aware of the timeline, and of your concerns. We’ll do what we can 🙂

  2. danielspain Avatar
    danielspain

    Another problem is that the notice will occur with wc 9.3.3 AND wp 6.7…so the problem is coming one way of another…the filter fix in my case doesn’t work…and for all people with non-english sites that will not upgrade wc 9.3.3 until a proper fix is done -but will upgrade wordpress to 6.7(a lot!)- the problem will appear…i hope a fix is coming fast as 9.4.1 release…thanks!

  3. Maxime Michaud Avatar
    Maxime Michaud

    Works perfectly, thank you! 🙂

  4. Maxime Michaud Avatar
    Maxime Michaud

    Works perfectly, thank you! 🙂
    Edit :
    Never mind, it was an HTTP 5xx error; that’s why the logs weren’t showing anymore. 😕 I’ve created a file in wp-content/mu-plugins called disable-doing-it-wrong.php, and it seems to be working fine.
    Here’s the content of disable-doing-it-wrong.php:

    <?php
    // Disable the ‘doing_it_wrong_trigger_error’
    add_filter(‘doing_it_wrong_trigger_error’, ‘__return_false’);

    Sorry for the double comment—I couldn’t reply to my pending comment waiting for approval

  5. Also not working in functions.php child theme.

    1. Barry Hughes Avatar
      Barry Hughes

      Your (child or parent) theme’s functions.php file isn’t a great spot for this snippet. It sounds like a code snippet plugin may work (they key thing is for the snippet to load early enough to take effect) and, if not, you might try a custom plugin or mu-plugin.

      A code snippet manager is probably the safest and easiest of those options, though.

  6. Since the update to 6.7, everything in several websites with Woocommerce shops is in English (including shopping cart, checkout, etc.). Although German is set everywhere in WordPress. This cannot be fixed either, an update would be appropriate.

    1. Peter, have you updated to the latest WooCommerce, version 9.4.1? There are still some translation issues which need to be addressed, but in conjunction with the steps-to-take in this article, you may see an improved experience if you download the latest update.

  7. Problem fixed, downgrade to WordPress 6.6

    1. Can you explain quickly how downgrade wordpress to 6.6 please ? Thanks a lot

      1. Hi Glock, I just provided some resources for a commenter below, which may be helpful:

        There are several ways you can downgrade WordPress, however if you are not very comfortable with code or managing the site through your host, then I would suggest you use a plugin to execute your downgrade.

        If you have Jetpack installed, you may be able to follow the instructions in this page.

        Your host may also have a “backup” functionality in your admin panel, which can be an option if you don’t have Jetpack.

        Finally, there is a manual way to downgrade WordPress, which requires being somewhat comfortable connecting to your site via SFTP. The guide above walks you through those steps here

  8. Hi, I don’t understand your troubleshooting instructions.
    I am a pure seller. Is there any way to fix this problem.
    Please make a gif or a video tutorial.
    My website is seriously affected.

    1. Brent MacKinnon Avatar
      Brent MacKinnon

      Hello! Have you had a chance to upgrade to WooCommerce 9.4.1?

      Some translation issues are still being worked on, but updating could improve your overall experience.

      1. As an online Seller you cant have always the newest woocommerce plugin version: If you update woocommerce you have to make all manuel changes in the code and settings again.

        The most Woocommerce seller i know update woocommerce 1 time a year. So we have downgraded to wordpress 6.6

        A Solution which works with older woocommerce Versions would be the solution otherwise Version 6.7 will get not very popular for woocommerce shop websites.

        1. Hi the issue was fixed after creating mu-plugin via previous comment.
          Thanks because somehow it works.
          I will sit tight and not update anything further.

  9. I did not realise that Woocommerce was aimed only at developers. I too, am just a seller and not very techy. If I had known that I would have to be a dev in order to fix problems like this myself, I would have run a mile and settled on a different ecommerce solution.

    Sorry if I sound a bit upset but my web site is broken.

    Some good people on here are suggesting that rolling back to the previous version of WordPress should fix this problem but I have no idea how to do that. Can it be done automatically with just a few mouse clicks or are we talking about editing loads of PHP files?

    1. Hi Tony, I understand your frustration. This blog is mostly aimed at developers who work with WooCommerce, but we want to make sure that everyone with a Woo store has a good experience.

      There are several ways you can downgrade WordPress, however if you are not very comfortable with code or managing the site through your host, then I would suggest you use a plugin to execute your downgrade.

      If you have Jetpack installed, you may be able to follow the instructions in this page.

      Your host may also have a “backup” functionality in your admin panel, which can be an option if you don’t have Jetpack.

      Finally, there is a manual way to downgrade WordPress, which requires being somewhat comfortable connecting to your site via SFTP. The guide above walks you through those steps here

  10. I feel like you doesn’t understand the impact of this issue. It is not only a warning but a full Error 502 : Bad gateway when language is set to other than english.
    I have WordPress 6.7 and woocommerce 9.4.1.

    I don’t care that log are flooded, but the site just doesn’t word with the plugin in this version. Only disabling the plugin woocommerce 9.4.1 shows that there is something wrong.

    Do you have any guidance or only wordpress downgrade ?

    1. Brent MacKinnon Avatar
      Brent MacKinnon

      Hey Nicodup, you might find the resources Pi has shared helpful:

      There are several ways you can downgrade WordPress, however if you are not very comfortable with code or managing the site through your host, then I would suggest you use a plugin to execute your downgrade.

      If you have Jetpack installed, you may be able to follow the instructions in this page.

      Your host may also have a “backup” functionality in your admin panel, which can be an option if you don’t have Jetpack.

      Finally, there is a manual way to downgrade WordPress, which requires being somewhat comfortable connecting to your site via SFTP. The guide above walks you through those steps here

  11. just switch your environment from development to production and WP_DEBUG_DISPLAY, false, would work

  12. Adrian Rus Avatar

    Add this line on functions.php

    add_action(‘init’, function() {
    load_textdomain(‘woocommerce’, WP_LANG_DIR . ‘/plugins/woocommerce-de_DE.mo’);
    });
    CHANGE THIS de_DE (WITH YOUR LANGUAGE)
    When woocommerce make an update you can remove this line

  13. hamish mckay Avatar
    hamish mckay

    My issue is that the emails send out from woocommerce to our clients is not being translated. I implemented to fix that @Adrian Rus mentions just above my comment but how can I fix the emails being send out ? Thanks

    1. Adrian Rus Avatar

      i work to make a code to fix emails.. and i rlly wait to wocommerce respond and fix this because is not hard to make a fix

  14. I’ve been putting off upgrading plugins and core WP for a short while due to encountering this issue in testing, and today couldn’t delay any longer and ran them. Am amazed this is still an issue. In my local environment the issue is the WooCommerce Stripe Gateway plugin, as in deactivating this stops the errors being created.

    Does that tally with your experience? Are you actually going to fix this? Am looking at moving our business away from WooCommerce as these kind of issues seem to be all too common

    1. Barry Hughes Avatar
      Barry Hughes

      In relation to Stripe specifically, please see the notes in this existing report. Assuming that matches the problem you are facing, then a fix has been developed and will be released soon (you will also find a pre-release containing the fix in the comments of that same report).

      1. Thanks for replying. Can you give a timeline for “soon”? This is creating a huge number of debug.log entries which is pretty annoying.

  15. I have multilanguage site and I am experiencing the same problem with WordPress 6.7.1. I would like to resolve an issue with loading translations by using the the code in functions.php, however, I noticed that I don’t have any .mo files (or their corresponding .po and .json files) for the WooCommerce translations in the expected location:

    wp-content/languages/plugins/woocommerce-de_DE.mo.

    Instead, I found ZIP files with language packs (e.g., woocommerce-de_DE.zip, woocommerce-fr_FR.zip, woocommerce-pl_PL.zip) stored in the wp-admin directory.

    I would like to know:

    Should these ZIP files be located in wp-admin, or is this a bug?
    Should I manually extract these ZIP files and move their contents to the wp-content/languages/plugins directory, or should this be handled automatically by WordPress or WooCommerce?
    Is there a better way to resolve this issue without manually extracting files?
    I would highly appreciate your response:)

Leave a Reply

Your email address will not be published. Required fields are marked *