-
Hey! Hope all is well.
I received the below email from Google Search Console for another website we manage, we created a ticket previously about the same issue here #310207;
=======
Sitelinks searchbox issues detected on gentlewench.com
To the owner of gentlewench.com:
Search Console has identified that your site is affected by 1 Sitelinks searchbox issues:
Top Errors
Errors can prevent your page or feature from appearing in Search results. The following errors were found on your site:
Custom query parameter not defined in target URL
We recommend that you fix these issues when possible to enable the best experience and coverage in Google Search.
=======
I have uploaded the file rank-math.php to the Theme directory but the validation is still not fixing things. Please can you confirm the URL we have included is correct?
The code is below.
Thanks
<?php
// Rank Math - removing error in Google Console
add_filter( 'rank_math/json_ld/search_url', function( $url ) {
if ( 'en' === ICL_LANGUAGE_CODE ) {
return 'https://www.gentlewench.com/?post_type=products&s={search_term_string}&lang=zh-hans';
}
return $url;
} );
The ticket ‘Custom query parameter not defined in target URL’ is closed to new replies.