WebSite schema markup: example, site names and WordPress setup
WebSite schema describes the site as a whole: what it is called, any alternate names, and its homepage URL. Its one job in Google today is site names, the name shown above your URL in search results. Google reads the WebSite markup on your homepage as its preferred source for that name.
For years WebSite markup was also used for the sitelinks search box, via a potentialAction of type SearchAction. Google retired that feature in November 2024. Existing SearchAction markup does no harm and does not need to be removed, but there is no reason to add it for Google.
JSON-LD example
Copy this into a <script type="application/ld+json"> tag and replace the values with your own.
{
"@context": "https://schema.org",
"@type": "WebSite",
"@id": "https://example.com/#website",
"name": "Greenroom Journal",
"alternateName": [
"Greenroom",
"GRJ"
],
"url": "https://example.com/",
"inLanguage": "en-US",
"publisher": {
"@id": "https://example.com/#organization"
}
}
Properties
| Property | Status | What it is |
|---|---|---|
name | Required | The site name you want Google to show, such as "Greenroom Journal". |
url | Required | The homepage URL of the domain or subdomain. |
alternateName | Recommended | Other names or an acronym the site is known by, in order of preference. |
publisher | Recommended | The Organization or Person behind the site, ideally referenced by @id. |
inLanguage | Recommended | The site's main language, such as "en-US". |
potentialAction (SearchAction) | Recommended | Describes your site search. Valid schema.org, but no longer used by Google for a search feature. |
When to use it
Add one WebSite block to your homepage, at the root of the domain or subdomain. That is where Google looks for site name markup; it does not need to be on every page.
Pick a name that is short, recognizable and consistent with how the site brands itself: the logo text, the <title> of the homepage, and your Organization name should agree. Use alternateName for a shorter version or acronym, which gives Google a fallback if it decides not to use the main name.
If Google shows the wrong site name, check that the homepage markup, title and headings use the same name, then request recrawling of the homepage.
Add it in WordPress
By hand. Print the JSON-LD from wp_head inside an is_front_page() check, using get_bloginfo( 'name' ) and home_url( '/' ).
With Hydrogen SEO. The Schema settings include a website name and alternate name, which are also brought across when you import from another SEO plugin. For custom WebSite properties, the hydrogen_seo_schemas filter can append a WebSite block on the front page; the plugin's filters reference includes exactly that example. View the homepage source afterward to confirm there is a single WebSite block.
Common mistakes
- WebSite on an inner page only. Site name markup belongs on the homepage.
- A name that doesn't match the site. If the markup says one thing and the homepage title another, Google may pick something else.
- Keyword-stuffed names. "Best Plant Care Tips Blog" is not a site name.
- Duplicate WebSite blocks from a theme and an SEO plugin with different names. Keep one.
- Adding SearchAction expecting a search box. The feature is gone.
More: invalid structured data.
Test it
Google's Rich Results Test does not report site names as a rich result type, so use the Schema Markup Validator (validator.schema.org) to confirm the WebSite block parses with the right name and URL. Test the live homepage after purging any cache. Site name changes appear in search only after Google recrawls the homepage, which you can request through the URL Inspection tool in Search Console.
Common questions
Does WebSite schema still give me a sitelinks search box?
No. Google retired the sitelinks search box in November 2024. WebSite markup is still used for site names.
Should I remove existing SearchAction markup?
There is no need. Google has said leftover markup does not cause problems. You can remove it whenever you next edit the template.
Why does Google show a different site name?
Google uses WebSite markup as its preferred signal but also looks at the homepage title, headings and other sources. Make them consistent and add an alternateName as a fallback.
Do subdomains need their own WebSite markup?
Yes, if you want a specific site name for the subdomain. Add the markup to the subdomain's homepage.