Content Error or Suggest an Edit
Notice a grammatical error or technical inaccuracy? Let us know; we will give you credit!
Introduction
If you’ve run into a warning like this:
Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ds-suit domain was triggered too early. This is usually an indicator for some code in the plugin or theme running 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 /wp-includes/functions.php on line 6121
You’re not alone. This message typically points to a translation file being loaded too early in the WordPress lifecycle — often before the init
action.
Why? Whats _load_textdomain_just_in_time?
WordPress introduced a warning when translation loading is triggered before init
, as it can cause unpredictable behaviour in multilingual setups.
WordPress now expects localization functions like load_plugin_textdomain()
or load_theme_textdomain()
to be hooked in at the right time. The init
action is the earliest safe place to load them.
Troubleshooting the _load_textdomain_just_in_time
Warning in WordPress
There’s a couple ways to tackle this issue.
If you’re a Plugin or Theme Developer
Here’s what not to do:
add_action('plugins_loaded', function() { load_plugin_textdomain('your-textdomain', false, '/path/to/languages/'); });
Instead, use:
add_action('init', function() { load_plugin_textdomain('your-textdomain', false, '/path/to/languages/'); });
The get_plugin_data Quirk
If you’re calling get_plugin_data()
before the init
hook, it can also cause issues. To avoid that, either:
- Pass
false
as the third parameter, or - Refactor your logic so the function only runs after
init
.
If you’re a Site Owner
You can do some basic steps.
- Update First – Before diving deeper, make sure all your plugins and themes are up to date. This may be a bug that’s already been resolved upstream.
- Contact Developers – If updates don’t fix it, report the issue to the plugin or theme authors. Include the exact error message to help them debug.
- Find the Culprit – Look at the “text domain” mentioned in the notice (e.g.,
houzez
orblahblah
). That’ll usually point to the plugin or theme responsible.
Dirty Resolution, Silence It!
If you don’t want to see the message anymore, you just need to add the following to your wp-config.php
define( 'WP_DEBUG_DISPLAY', false );