WebSite schema is a piece of JSON-LD structured data that tells Google your site’s official name and, optionally, that it supports search. Add it to your homepage and you give search engines a clean signal about what your site is called, with the chance to unlock a sitelinks search box in results. Here is what it does and how to generate it.
What WebSite schema does
WebSite schema is a small block of JSON-LD you place on your homepage. At its core it declares two things: the name of your site and its url. That alone helps Google understand your site name, which can influence how your brand is displayed in search results instead of a guessed-at title.
The more powerful part is the optional potentialAction. By adding a SearchAction, you describe how visitors can search your site directly from Google. This is the markup behind the sitelinks search box, a search field that can appear right under your site in the results.
How the sitelinks search box works
The SearchAction includes a urlTemplate that points to your site’s search results page. Inside that template you place a token that marks where the search query goes, written as the search-term placeholder rather than a literal value. When someone types a query into the box, Google swaps their words into that spot and sends them straight to your search results.
A few things to keep in mind:
- The markup belongs on the homepage, since that is where Google looks for site-wide signals.
- A sitelinks search box is never guaranteed. The markup makes you eligible; Google decides whether to show it.
- Your search URL must actually work. Test the template by pasting a real query in place of the placeholder.
Generate WebSite schema in three steps
- Open the Website Schema Generator and enter your site name and homepage URL.
- Add your search URL template, marking where the query term belongs, if you want the sitelinks search box.
- Copy the generated JSON-LD and paste it into the head of your homepage.
The Website Schema Generator builds the JSON-LD entirely in your browser, so nothing you type is sent to a server. After you add it, run the output through Google’s Rich Results Test to confirm it validates before you publish.
Related tools
- Favicon Checker: confirm the icon Google pairs with your site name is set up correctly.
- Article Schema Generator: add structured data to blog posts and articles.
- FAQ Schema Generator: mark up question-and-answer content for richer results.
Drop your name and URL in, add a search template if you want the box, validate, and ship it.