Custom query parameter not defined in target URL?

#331937
  • Resolved AndivomBerg
    Rank Math free

    Hi there!

    Since I activated Rank Math some days ago I get several Errors from the Google search console. One I can’t really handle is this: “Custom query parameter not defined in target URL”

    The URL Google names is “https://trachtenstrip.de/?lang=en”, so I think it has to do something with my (WPML-)Translation. I googled the issue, but I didn’t find a propper solution, so I want to ask you for assistance. Could you please help me with this issue?

    Best regards
    Andi

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.

    The error is because the Sitelinks Searchbox schema is not rendering special characters correctly.

    To fix this, you can use this filter on your site:

    
    add_filter( 'rank_math/json_ld/search_url', function( $url ) {
    if ( 'en' === ICL_LANGUAGE_CODE ) {
    return 'https://trachtenstrip.de/?lang=en&s={search_term_string}';
    }
    return $url;
    } );

    The filter should be added to your active theme’s functions.php file. Here’s another way to apply the filter using the rankmath.php file:
    https://rankmath.com/kb/filters-hooks-api-developer/#adding-filters-and-hooks-in-rank-math-php

    Once done, clear your website’s cache and check again the URL using Google’s Rich Results test. If the issue is already fixed there, you can validate the error in your Google Search Console account.

    I hope that helps.

    Thank you.

    Thank you! I’ll give it a try and report! 🙂

    Hello,

    Sure, let us know how it goes.

    Meanwhile, please don’t hesitate to contact us anytime if you have other questions to assist you further.

    Looking forward to helping you.

    Thank you.

    Working now. 🙂

    Hello,

    Thank you for the update, and we’re glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Custom query parameter not defined in target URL?’ is closed to new replies.