Key Takeaways
- WebSite Schema with SearchAction tells search engines and AI models that your site has internal search, enabling the Google sitelinks search box
- Place this markup on your homepage only -- it describes the website as a whole, not individual pages
- The
potentialActionproperty withSearchActionrequires a working internal search URL with a query parameter template - WebSite Schema helps AI models correctly identify your site by name and understand its scope, contributing to entity recognition
- Combine WebSite Schema with Organization Schema on your homepage for comprehensive site-level structured data
Is your Schema markup helping AI find you? Check your AI visibility for free -- no signup required, results in 60 seconds.
Table of Contents
What Is WebSite Schema?
WebSite Schema is a schema.org type that describes a website as a whole -- its name, URL, alternative names, publisher, and search capabilities. Unlike Article or Product Schema that describe individual pages, WebSite Schema provides metadata about the entire site, helping search engines and AI models understand the entity that your website represents.
When combined with the SearchAction property, WebSite Schema also tells Google and AI systems that your site offers internal search and provides the URL pattern needed to execute searches. This enables features like Google's sitelinks search box and helps AI models understand the navigational structure of your site.
WebSite Schema is one of the foundational schema types you should implement alongside Organization Schema. Together, they give AI models a complete picture of who you are (Organization) and what your site offers (WebSite). For the broader context on structured data in AI SEO, see our JSON-LD basics guide.
The SearchAction Component
SearchAction is a schema.org action type that describes how to perform a search on your website. When nested inside WebSite Schema as a potentialAction, it tells search engines the exact URL pattern to use when sending a search query to your site.
The SearchAction requires two key pieces of information:
- Target URL template -- The URL pattern with a placeholder for the search query (e.g.,
https://example.com/search?q={search_term_string}) - Input specification -- The name of the query parameter and whether it is required
When Google encounters this markup, it may display a sitelinks search box in search results for your brand, allowing users to search your site directly from Google's results page.
How it works technically
When a user types a query into the sitelinks search box, Google replaces the {search_term_string} placeholder in your target URL with the user's query and redirects them to the resulting URL on your site. This means your internal search must accept the query parameter you specify and return relevant results.
Complete Implementation Example
Here is the complete JSON-LD implementation for WebSite Schema with SearchAction. This block should be placed on your homepage.
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "AImetrico",
"alternateName": ["AI Metrico", "AImetrico.com"],
"url": "https://aimetrico.com",
"description": "AI SEO visibility platform for measuring and improving your presence in AI-generated search results.",
"publisher": {
"@type": "Organization",
"name": "AImetrico",
"url": "https://aimetrico.com"
},
"inLanguage": "en",
"potentialAction": {
"@type": "SearchAction",
"target": {
"@type": "EntryPoint",
"urlTemplate": "https://aimetrico.com/search?q={search_term_string}"
},
"query-input": "required name=search_term_string"
}
}
Key elements explained
name-- Your website's official name, exactly as you want AI to reference italternateName-- Common variations, abbreviations, or misspellings users might useurl-- The canonical homepage URL (with https://)publisher-- Reference to your Organization entitypotentialAction-- The SearchAction block with your search URL templatequery-input-- Tells Google the placeholder name and that a query is required
Required and Recommended Properties
The following table lists all properties for WebSite Schema, indicating which are required for basic functionality and which are recommended for optimal AI SEO.
| Property | Required | Description |
|---|---|---|
| @type | Yes | Must be "WebSite" |
| name | Yes | Official name of the website |
| url | Yes | Canonical homepage URL |
| alternateName | Recommended | Array of name variations, abbreviations |
| description | Recommended | Brief description of the website's purpose |
| publisher | Recommended | Reference to the Organization entity |
| inLanguage | Recommended | Primary language code (e.g., "en") |
| potentialAction | For search box | SearchAction with target URL template |
| query-input | For search box | Input specification for the search parameter |
The alternateName property and AI
The alternateName array is particularly valuable for AI SEO. AI models sometimes receive queries that use variations of your brand name ("AImetrico" vs "AI Metrico" vs "aimetrico.com"). By listing common variations in alternateName, you help AI models recognize that these all refer to the same entity.
The Sitelinks Search Box
The sitelinks search box is a Google Search feature that displays a search field directly in the search results when users search for your brand name. This allows users to search your website without first visiting your homepage. It appears below your site's main listing with an input field labeled "Search [sitename]."
Requirements for the sitelinks search box
- WebSite Schema with SearchAction on your homepage
- A working internal search that returns relevant results
- Sufficient site authority -- Google decides whether to display the search box based on your site's importance and user behavior
- Correct URL template -- The
urlTemplatemust work when the placeholder is replaced with a real query
Opting out
If you do not want the sitelinks search box (for example, if your internal search provides poor results), you can signal this to Google using a meta tag:
<meta name="google" content="nositelinkssearchbox">
However, for most sites, the sitelinks search box is a positive feature that increases engagement and demonstrates site authority.
WebSite Schema for AI SEO
Beyond the sitelinks search box, WebSite Schema provides several AI SEO benefits that make it worth implementing even if Google does not display the search box for your site.
Entity recognition
The name and alternateName properties help AI models identify your website as a distinct entity. When ChatGPT encounters a reference to "AImetrico" in web content, the WebSite Schema confirms that this is the name of a specific website at aimetrico.com -- not a generic term or a different entity.
Site scope understanding
The description property tells AI models what your site is about at a high level. This influences which queries AI considers your site relevant for. A description like "AI SEO visibility platform for measuring and improving your presence in AI-generated search results" helps AI match your site to queries about AI SEO tools.
Publisher chain
The publisher property links your website to your Organization entity, creating a structured relationship that AI models use to assess authority. This is especially important when combined with Organization Schema that includes sameAs links to your social profiles, Wikipedia page, and other authoritative references.
Combining with Organization Schema
Your homepage should typically include both WebSite Schema and Organization Schema. These serve complementary purposes:
- WebSite Schema -- describes the website (name, URL, search capability)
- Organization Schema -- describes the organization behind it (team, contact, social profiles)
Both can be placed on the same page as separate JSON-LD blocks.
Common Implementation Mistakes
Avoid these frequent errors when implementing WebSite Schema with SearchAction.
-
Placing WebSite Schema on every page -- WebSite Schema belongs on the homepage only. Inner pages should use Article, Product, FAQPage, or other page-specific schema types.
-
Invalid search URL template -- The
urlTemplatemust work when the placeholder is replaced with a real query. Test by manually substituting a search term into the URL and verifying that your site returns results. -
Missing
query-inputproperty -- Thequery-inputfield tells Google how to use the URL template. Without it, the SearchAction is incomplete and the sitelinks search box will not appear. -
Inconsistent site name -- The
nameproperty in WebSite Schema must match the site name used in your title tags, Organization Schema, and other references. Inconsistency confuses entity recognition. -
Using http instead of https -- The
urlproperty must use https if your site uses HTTPS. A mismatch can prevent proper entity matching. -
Forgetting
alternateName-- If users commonly misspell or abbreviate your brand name, include those variations. This small addition improves AI entity matching for queries using non-standard name forms.
For validation of your implementation, use the tools described in our testing structured data guide.
Frequently Asked Questions
What is WebSite Schema with SearchAction?
WebSite Schema with SearchAction is a JSON-LD structured data block that tells search engines and AI models your site has internal search. It specifies the URL pattern for queries, enabling Google's sitelinks search box and helping AI models understand your site's scope and navigability.
Does WebSite Schema help with AI SEO?
Yes. WebSite Schema provides AI models with metadata about your site -- name, URL, alternative names, and search capability. This helps AI correctly identify and reference your website. The SearchAction signals substantive, searchable content, which is an indirect trust signal.
Where should I place WebSite Schema markup?
Place it on your homepage only. WebSite Schema describes the website as a whole. Inner pages should have their own relevant schema types (Article, Product, FAQPage). Do not duplicate WebSite Schema on every page.
What is the sitelinks search box?
The sitelinks search box is a search field in Google's results when users search your brand name. It lets users search your site directly from Google. WebSite Schema with SearchAction provides Google the URL template to power this feature.
Can I use WebSite Schema without internal search?
Yes. Use the basic properties (name, url, alternateName, description) without the potentialAction SearchAction block. The site identification properties still help AI models recognize your brand as a distinct entity.
Ready to check your AI visibility?
Get your free AI Score in 60 seconds -- see how AI models understand your website.
Trusted by 2,400+ websites -- No credit card required