Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Yoast SEO Premium 27.7, the warning is still there. It’s disappointing to pay for support of this quality.
    Personaly I have added this code in the directory mu-plugins

    <?php
    add_filter(
    ‘doing_it_wrong_trigger_error’,
    static function ( bool $trigger, string $function_name ): bool {
    if ( ‘_load_textdomain_just_in_time’ === $function_name ) {
    return false;
    }
    return $trigger;
    },
    10,
    2
    );

    Thread Starter nicolaspl

    (@nicolaspl)

    Hello,

    Has I already said, “I already chatted with a member of your team in February about this bug.”

    I post here not for help by the Yoast team but a person who have solved the problem.
    Thank you for your work if this person exist and share his solution.

    Can you just re-open the thread for the many person who have the problem, we are many and you systematically close our threads without cary any solutions
    Thank you

    Hello,
    I have Yoast SEO and Yoast SEO Premium version 26.2, the bug stays present.
    It’s been present for many months, I already chatted with a member of your team in February about this bug.
    It’s a real bug, a default in your code, not a fatal or a warning but a notice filling rapidly our .log files and requiring regular intervention on our servers to remove .log files.
    Please, it is really annoying, can you look into this matter?

    It is what I have in my log
    “[27-Oct-2025 10:56:04 UTC] PHP Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo 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″

    Thread Starter nicolaspl

    (@nicolaspl)

    Hello,

    Ideally, in my case, the pages “/page/*/amp” should not exist.
    It might be interesting to have a hook in the “amp_is_available” function to be able to manage if a particular page exists in AMP and avoid to use redirection with the “noamp” variable.

    Actually I use the hook “amp_supportable_post_types” like this.

    Have a good day.

    function amp_supportable_post_types($post_types) {
    return preg_match('/\/page\//', $_SERVER['REQUEST_URI']) === 1 ? [] : $post_types;
    }
    add_filter('amp_supportable_post_types', __NAMESPACE__.'\amp_supportable_post_types');
    • This reply was modified 1 year, 6 months ago by nicolaspl.
    • This reply was modified 1 year, 6 months ago by nicolaspl.
    Thread Starter nicolaspl

    (@nicolaspl)

    Not only pagination links, that’s where my problem lies.
    I need to check if all pages have the “AMP” option active.
    I already create a code snippet like yours when I was browsing your plugin code.

    As I thought, there is no simple solution to my case, I will check all “AMP” options for URLs present on “AMP” pages.

    Thank you for your time.

    /**
    * Remove "/amp" from URL without AMP version
    * @param $excluded
    * @param $url
    * @return bool
    */
    function remove_amp_from_url($excluded, $url) {
    if (!$excluded) {
    if (get_home_url() === trim($url, '/') || str_contains($url, '/page/')) {
    return true;
    }
    }

    return $excluded;
    }
    add_filter('amp_to_amp_linking_element_excluded', __NAMESPACE__.'\remove_amp_from_url', 10, 2);
    Thread Starter nicolaspl

    (@nicolaspl)

    Hello,

    Into doubt, I did what you explained but that’s not what I want.
    I didn’t say I wanted to disable my AMP pages, just “/amp” URLs in this pages.

    For exemple, in “https://www.monpetitforfait.com/actualites/page/2/amp” I want to keep this URL like this.
    Simply remove all “/amp” for pages that don’t have an AMP version.
    This URL “https://www.monpetitforfait.com/comparatif-forfaits-pas-chers/amp” is present on “https://www.monpetitforfait.com/actualites/page/2/amp” but not exist and create a redirection.

    For information, I have already looked if a hook could do the necessary and I only found this one “amp_to_amp_linking_element_excluded” but which would requires me to check on each URL is they have the AMP option activated which is quite heavy.

    Hope my explanation is clear.
    Thank you for your help.

    Thread Starter nicolaspl

    (@nicolaspl)

    Thank you for your feedback
    We do not want to unactivate fort this post type.
    Only not have “/amp” for non-AMP pages. As in our navigation, mainly pages are non-AMP pages but have the “/amp”.

Viewing 7 replies - 1 through 7 (of 7 total)