Guide · Structured data
The sitelinks search box and site names
Thousands of sites copied Google’s sitelinks search box example with query.example-petstore.com as the search address. The feature is gone, but the markup is still around. This guide explains what it did and what to use instead.
What the markup did
Google could show a search box directly below a site’s result. A site asked for it with a WebSite block
containing a SearchAction. Whatever a searcher typed replaced {search_term_string} in the
target, and Google sent them to that address: the site’s own search results page.
{
"@context": "https://schema.org",
"@type": "WebSite",
"url": "https://www.example-petstore.com/",
"potentialAction": {
"@type": "SearchAction",
"target": "https://query.example-petstore.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}
In Google’s example, query.example-petstore.com was the made-up address of the pet store’s search page.
It never existed. Even in 2014, Google required the target to be on the same domain as the site, so the example
target could never work for anyone else’s site.
Timeline
- September 2014 — the first version of Google’s documentation uses
host.example-petstore.com/search?q={search_term}. - September 2014 to mid-2015 — the best-known version with
query.example-petstore.com/search?q={search_term_string}, copied by SEO blogs, forum software and themes. - 2016 — Google’s documentation switches to
example.com. - 21 November 2024 — Google stops showing the sitelinks search box worldwide. Leftover markup causes no errors in Search or Search Console.
What to use today
The SearchAction no longer has a visible effect in Google Search. A WebSite block with your
own name and address still helps Google choose the site name shown in results. Put it on your home page only:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "Your site name",
"url": "https://www.example.com/"
}
</script>
You may add alternateName for a common short name. Leave out potentialAction, or point it at
your own search page if another consumer still uses it.
Fix it
- Open the source of your home page and search for
example-petstore. - If the block comes from your theme or a “custom head code” field, edit it there. If it comes from an SEO plugin, check its settings: Yoast SEO, Rank Math and All in One SEO build the markup from your own address.
- Replace
urlwith your own home page and setnameto your site name. Remove theSearchAction. - To remove the plugin’s search action as well: Yoast
add_filter( 'disable_wpseo_json_ld_search', '__return_true' );, Rank Math filterrank_math/json_ld/disable_search, All in One SEO Search Appearance › Advanced › Enable Sitelinks Search Box off. SEOPress removed it in version 8.1. - In Search Console, use URL Inspection › Request indexing for your home page.
Verify
- The page source contains one
WebSiteblock with your ownnameandurl. - The Schema Markup Validator shows the item without errors. The Rich Results Test does not cover site names.
- No page on your site mentions
example-petstore.com.
Sources
- Sitelinks search box (September 2014 snapshot) Google Developers via the Wayback Machine
- Sitelinks search box (2015 snapshot) Google Developers via the Wayback Machine
- Farewell, Sitelinks Search Box Google Search Central Blog
- Site names in Google Search Google Search Central
- Schema Markup Validator Schema.org
- Yoast: SearchAction Yoast
- Rank Math: sitelinks search box schema Rank Math
- AIOSEO: sitelinks search box All in One SEO