sitelinks searchbox wrong output

  • This is the official code from Google for the Implementation of a sitelinks searchbox

    <script type="application/ld+json">
      "@context": "",
      "@type": "WebSite",
      "url": "",
      "potentialAction": {
        "@type": "SearchAction",
        "target": "{search_term_string}",
        "query-input": "required name=search_term_string"

    Where search_term_string should be the attr name of the query input. So in WP it would normally be s.

    RankMaths Code produces this:

    <script type="application/ld+json">{
    	"@context": "https:\/\/"
    	, "@type": "WebSite"
    	, "@id": "https:\/\/\/#website"
    	, "url": "https:\/\/"
    	, "name": "Website Name"
    	, "potentialAction": {
    		"@type": "SearchAction"
    		, "target": "https:\/\/\/?s={search_term_string}"
    		, "query-input": "required name=search_term_string"
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

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

    I have just raised this issue with our dev team and we will be looking into this and get back to you in a short while.

    We appreciate your patience. Thank you.



    In the example provided by Google that you pasted here, the search_term_string is actually a placeholder, as described on this page:

    A placeholder string that is replaced by user’s search query when the user clicks the “Search” button in the search box.

    The part that needs to be changed to make it work on most WordPress sites is the ?q= because WordPress uses the s parameter for the search query.

    The code inserted by Rank Math is therefore correct.

    Hope that helps.

    ah thanks… sorry was a bit confused about an example which used the search_term_string as the real input name..

    Hi Bastian,

    Thanks for the follow up.

    I am glad that this information was useful 🙂

    Feel free to contact us should any other issues come up.

    Thank you.

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

The ticket ‘sitelinks searchbox wrong output’ is closed to new replies.