Custom query parameter not defined in target URL

#102694
  • Resolved Magaya
    Rank Math pro

    Hello,
    I received the Google Console Error “Custom query parameter not defined in target URL” on several of my Spanish pages (it’s a multilingual EN/SP site) after installing Rank Math. I did a search and a previous poster that had the same issue was told that the warning could be ignored. I just want to be certain that it is the same case for my site. Is this something that needs to be fixed or can be ignored?
    Thanks!
    Danya

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

    Thank you for contacting Rank Math and sorry for any inconvenience that might have been caused due to that.

    Did you go through the solution shared here: https://support.rankmath.com/ticket/custom-query-parameter-not-defined-in-target-url/?view=all

    Could you please share your URL so we can check from our end? You can also include a screenshot of the issue from your end in the sensitive section. To share a screenshot, use https://imgur.com

    Looking forward to helping you. Thank you.

    ​​​​​​​

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,
    I added a screenshot in the sensitive section. We don’t have a search box on our site, so I’m not really sure what to do when it comes to the other link you shared. It looks like the issue only affects our Spanish pages.
    Thanks,
    Danya

    Hello Danya,

    The screenshot you shared doesn’t seem to be loading from my end.

    Could you please share your site URL so we can check from our end? Rank math should automatically add the sitelinks search box markup to your site.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    After checking your site further, it seems translating your page also encodes the curly brackets which are usually added to your homepage from s={search_term_string} to s=%7Bsearch_term_string%7D. This is what is causing the issue. You can try customizing and adding the following filter to your theme functions.php to defined the sitelinks URL and keep it from being modifed in translation:

    
    add_filter( 'rank_math/json_ld/search_url',  function( $url ) {
        if ( 'es' === ICL_LANGUAGE_CODE ) {
            return 'https://your_site_url.com/?s={search_term_string}';
        }
        return $url;
    } );
    

    Looking forward to helping you. Thank you.

    ​​​​​​​

    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 6 replies - 1 through 6 (of 6 total)

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