PHP Notice: load_textdomain called too early (WP 6.7 compatibility issue)

#1063670
  • Resolved 360 stone
    Rank Math free

    Hi,

    Since updating to WordPress 6.7.0, my debug.log file keeps filling up with PHP Notices related to Rank Math and the Instant Indexing plugin.

    Message:
    Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the ‘rank-math’ or ‘fast-indexing-api’ domain was triggered too early.

    It seems the plugin is calling load_textdomain() before the init hook, which now triggers this warning in WordPress 6.7+.

    To resolve this, please defer translation loading like this:

    add_action( ‘init’, function() {
    load_plugin_textdomain( ‘rank-math’, false, dirname( plugin_basename( __FILE__ ) ) . ‘/languages’ );
    });

    This would comply with WP core standards and stop the debug log from growing unnecessarily.

    I’m using Rank Math Pro + Instant Indexing with a valid JSON key, so I’d prefer not to disable it.

    Thanks!

Viewing 1 replies (of 1 total)
  • Hello,

    We apologize for the issue you are facing with the PHP Notices after updating to WordPress 6.7.0. Thank you for bringing this to our attention.

    The warning you are seeing indicates that the translation loading for the Rank Math and Instant Indexing plugins is being triggered too early in the WordPress lifecycle. Your suggested solution to defer translation loading by using the init hook is indeed a valid approach to resolve this issue.

    However, since this involves modifying plugin code, we recommend that you reply to your ticket with this information. A human agent from the Rank Math Support team will be able to assist you further and ensure that your plugins are compliant with the latest WordPress standards without causing any issues.

    If you have any other questions or need further assistance, please feel free to let us know!

    Sources:
    How to Fix Undefined Offset: 0 Warning » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘PHP Notice: load_textdomain called too early (WP 6.7 compatibility issue)’ is closed to new replies.