example-petstore.com

Example domain · Not a live service · Browser visits show this page · API requests get 410 Gone

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

  1. September 2014 — the first version of Google’s documentation uses host.example-petstore.com/search?q={search_term}, until late September 2014.
  2. October 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.
  3. By September 2015 — Google’s documentation switches to example.com.
  4. 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

  1. Open the source of your home page and search for example-petstore.
  2. 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.
  3. Replace url with your own home page and set name to your site name. Remove the SearchAction.
  4. To remove the plugin’s search action as well: Yoast add_filter( 'disable_wpseo_json_ld_search', '__return_true' );, Rank Math filter rank_math/json_ld/disable_search, All in One SEO Search Appearance › Advanced › Enable Sitelinks Search Box off. SEOPress removed it in version 8.4 (December 2024).
  5. In Search Console, use URL Inspection › Request indexing for your home page.

Verify

  • The page source contains one WebSite block with your own name and url.
  • 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