WordPress 6.7 introduced a new notice:
Function _load_textdomain_just_in_time was called incorrectly. Translation loading for themy-text-domaindomain 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 theinitaction or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.)
Unfortunately, this warning is too broad and it does not tell us where the problem is. However, there is a way to solve this and you are in the right place, as I am going to show you how to do it.

Simply put, the error means that there is a WordPress translation function that is called too early. This means you have code that is trying to use an internationalization function way too early before the init hook or after_setup_theme:
__( 'My translated string', 'my-text-domain' )
Hide the Notice with wp-config.php
This notice (it’s not an actual error) occurs when you have enabled wp_debug on your website. The easiest way to get rid of the notice is to turn off WP_DEBUG. WP_DEBUG should be set to true, only when debugging but should be false in production mode. To hide the notice, simply locate the wp-config.php file. It should be in the root folder of your WordPress installation. Use FTP or CPanel from your web hosting’s interface to reach it. Once there, update the following line:
define( 'WP_DEBUG', false );
In this way, you will hide the notice from appearing in the WordPress admin.
Find and Fix the Issue in the Codebase
Hiding a notice is not an actual fix but more like putting a bandage. The above solution is perfectly fine if you are using a third-party code and you cannot edit theme or plugins directly. This section is for more advanced users who would not be content with just hiding the notice but are looking for an actual fix. To do that, you need to find out where is the actual problem is. It will be either the theme or any of the active plugins. Try switching off your plugins one by one and change your theme with any of the default WordPress themes until you find which software is causing the issue. After that, study the translation functions in the theme/plugin to see if any of them is running too early, before the init or after_setup_theme. Examples of such early hooks are plugins_loaded, setup_theme or register_default_headers. You need to remove the calls to any internationalization functions from there. In my case, it was this code that was triggering the notice:
register_default_headers(
array(
'default-image' => array(
'url' => get_template_directory_uri() . '/assets/img/patterns/contact-us.jpg',
'thumbnail_url' => get_template_directory_uri() . '/assets/img/patterns/contact-us.jpg',
'description' => __( 'Default Header Image', 'text-domain' ),
),
)
);
The problem was solved by removing the description element from the array. If this is a third-party code, contact the theme/plugin author and request a code update. Don’t edit theme/plugin files directly, as your changes will be lost with the next update.

