Custom query parameter not defined

#497958
  • Resolved Odysseus
    Rank Math free

    I recently translated my site into German and published it.
    Now I received an alert from google:

    –> Sitelinks searchbox structured data issues detected in greatergood-leadership.com

    To the owner of greatergood-leadership.com:

    Search Console has identified that your site is affected by 1 Sitelinks searchbox structured data issue(s). The following issues were found on your site.

    Top critical issues*

    Custom query parameter not defined in target URL (in “potentialAction.target”)

    *Critical issues prevent your page or feature from appearing in Search results.

    We recommend that you fix these issues when possible to enable the best experience and coverage in Google Search.

    ——–
    Link to a page where the issue can be seen: https://www.greatergood-leadership.com/?lang=de
    ——–
    How can I ensure that my translated site can be found in Google in all languages, and the error message from google stops?

Viewing 1 replies (of 1 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, please try using this filter on your site:

    add_filter( 'rank_math/json_ld/search_url', function( $url ) {
    if ( 'de' === ICL_LANGUAGE_CODE ) {
    return 'https://www.greatergood-leadership.com/?s={search_term_string}&lang=de';
    }
    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.

    Regarding your translated pages on SERPs, translation plugins like WPML add hreflang to the translated pages so Google can figure out that a particular page is a translated version of another page on your website.

    I hope that helps.

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

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