Sitelinks Search box schema confusion
Trying to implement Sitelinks Search box schema in order to help Google show a search-box above my sitelinks I realized there is some confusion (for a newbie) in the current documentation I could find.
This is the example provided by Google
"@context": "http://schema.org",
"@type": "WebSite",
"url": "https://www.example.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://query.example.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
First of all, for WP, we should replace the ?q
with ?s
However there are more questions
1. Use search_term_string
or search_term
Reading the code provided in some helpful articles on the web and even the code of some plugins, almost half of them use search_term
instead of search_term_string
.
Which one should I use? Are both correct? Is WP actually using these expressions in their core?
2. Testing the code
Google (which is the reason we care about the searchbox in the first place) suggest this type of testing your markup:
...if your website is example.com, and you want to test the query "kittens", you would browse to https://www.example.com/search/?q={kittens}
Ignoring the fact that it uses ?q
instead of ?s
this test is not successful for any of the found solutions. As this is how WP search url looks like:
https://www.example.com/search/?s=kittens
The question is:
Can I use either of search_term_string
or search_term
, forget about google test query and move on?
Topic google-search Wordpress search
Category Web