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.