WebSite Schema Generator — Define Site Identity and Search
Generate valid WebSite JSON‑LD to clarify your site entity and optionally enable a sitelinks searchbox with a correctly configured SearchAction.
Why many sites miss foundational signals
Pain points we solve
- Inconsistent brand identity (name/URL/logo) across pages and properties.
- No sitelinks searchbox because SearchAction is missing or misconfigured.
- Crawl issues: search endpoint can’t accept query parameters or returns no results.
- Disjointed entity signals without Organization/Logo and Breadcrumb support.
How SwiftSchema helps
Solution
The WebSite generator produces a clean JSON‑LD block that identifies your site entity (name and URL) and supports adding a SearchAction for a sitelinks searchbox.
Pair WebSite with Organization (and a crawlable logo) plus Breadcrumb to establish a cohesive, consistent foundation across your site.
We make it easy to copy a script‑ready block and deploy it once site‑wide.
How it works
How it works
- Choose WebSite in the generator below.
- Enter your site name and canonical URL.
- Add a SearchAction under potentialAction using your site search URL pattern with `{search_term_string}`.
- Verify your search page accepts the query parameter and returns results.
- Copy JSON or Script, deploy site‑wide (e.g., in your layout), and validate in the Rich Results Test.
Deploy once site‑wide. Validate. Ship.
What is WebSite structured data?
WebSite identifies your site as an entity and can enable a sitelinks searchbox when a proper SearchAction is present and Google chooses to show it.
Eligibility & status
WebSite markup is fully supported. The sitelinks searchbox is optional—Google decides when to show it, even if your JSON‑LD is perfect. Eligibility requires that your search experience be available to Googlebot (no login), accept query parameters, and return relevant results. WebSite should also align with Organization and Logo markup so branding is consistent. If you don’t have on-site search, you can still use WebSite to define basic site identity without
Why WebSite markup matters
- Entity foundation: It’s the root of your structured data graph; other schema types reference the same @id.
- Brand coherence: Keeping name, URL, and SearchAction in sync ensures knowledge panels and search snippets use the right brand signals.
- Search UX: When the sitelinks searchbox appears, users can query your site directly from Google results, driving higher intent traffic.
- Governance: A canonical WebSite entry forces teams to align on the official domain, canonical host, and search endpoint.
- Localization: Multi-domain brands can define separate WebSite entries per locale, clarifying how each site fits into the ecosystem.
Essential properties to include
- name: Official site or brand name, matching Organization schema.
- url: Canonical root domain (https).
- @id(optional but recommended): Use it as an anchor for other schema references.
- potentialAction(SearchAction):targetwith{search_term_string}placeholder plusquery-input.
- inLanguageandalternateNamefor localized variants.
- publisherorcreatorreferencing Organization.
- Optional: sameAslinks,about,audience,issn,copyrightHolder.
Preparing information before generating schema
- Confirm canonical domain: Decide whether you use www, enforce HTTPS, handle subdomains, etc.
- Audit search experience: Ensure your search results page accepts a query parameter and returns HTML (not just JS requiring post-load auth).
- Gather brand assets: Align site name with Organization + Logo schema. Know which entity @idothers should reference.
- Map locales: For multilingual sites, decide if each locale has its own WebSite entry or shares one with inLanguage.
- Test search URLs: Validate that https://example.com/search?q=customerreturns results and doesn’t break when encoded.
- Assign owners: Typically SEO or platform engineering owns WebSite schema. Document where it lives (global layout, tag manager).
- Plan monitoring: Set up Lighthouse/RUM or availability checks on the search endpoint to catch outages that could disable the sitelinks box.
Implementation workflow inside SwiftSchema
- Launch the WebSite generator.
- Input name,url, optional@id,description, andinLanguage.
- Reference your Organization entity in publisherorcreator, ensuring logos and sameAs links align.
- Configure potentialActionwith a SearchAction targeting your search results page:https://example.com/search?q={search_term_string}. Setquery-inputtorequired name=search_term_string.
- If you provide site search via path segments (e.g., /search/{search_term_string}), encode the placeholder accordingly.
- Export JSON‑LD and place it inside your root layout so it appears site-wide (Next.js layout.tsxor similar).
- Validate via the Rich Results Test and confirm Search Console’s Enhancements report shows WebSite status without errors.
Troubleshooting & QA
- SearchAction failures: If your search endpoint returns a 500 or requires JavaScript post requests, the sitelinks box may disappear. Use GET requests with query parameters.
- Multiple WebSite snippets: Only include one per domain. Remove duplicates from plugins or tag managers to reduce conflicting data.
- Wrong domain: If you operate multiple brands, ensure each layout loads the correct WebSite entry. Don’t point to example.co.ukon the US site.
- Staging leakage: Don’t let staging deployments expose WebSite markup referencing staging URLs; Google could crawl them unexpectedly.
- Localization: When using subdirectories for locales (/de/), ensure hreflang and WebSite metadata reference the same canonical host.
Maintenance and governance
- Review structured data whenever you redesign navigation, update search endpoints, or rebrand. WebSite fields should change rarely; treat updates as part of change management.
- Monitor Search Console for sitelinks searchbox errors and fix them quickly (broken search endpoints, invalid query parameters).
- When launching new domains or microsites, create new WebSite entries and update Organization schema to reflect relationships.
- Maintain a central document describing @idconventions so other schema types can reuse the same identifier.
- Log the lastRevieweddate and caretaker (SEO lead, platform engineer) for compliance.
Common Errors & Fixes
- Incorrect query parameter: match your actual site search parameter name.
- Inactive search: ensure the target results page is live and crawlable.
- Missing Organization/Logo: add Organization with a crawlable ImageObject logo for stronger brand signals.
- Duplicate SearchAction entries: keep a single, validated action to avoid conflicting instructions.
- Using POST-based search: convert to GET or provide a GET parameter wrapper so Googlebot can call it.
Required properties
name
Recommended properties
urlpotentialAction (SearchAction)
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "SwiftSchema",
"url": "https://www.swiftschema.com",
"potentialAction": {
"@type": "SearchAction",
"target": "https://www.swiftschema.com/search?q={search_term_string}",
"query-input": "required name=search_term_string"
}
}