Skip to content

Discoverability: SEO and structured data for PWAs

Published

In one line: per MDN, distributing a PWA as a website (rather than only through an app store) makes it “discoverable through web search,” and per Google, structured data gives search engines “explicit clues” about what a page’s content means.

Per MDN’s PWA installability guide, shipping a PWA as a website “means you can distribute your PWA as a website, making it discoverable through web search, and also distribute it in app stores, so users can find it there.” Per Google Search Central, “structured data is a standardized format for providing information about a page and classifying the page content,” and Google states it “uses structured data that it finds on the web to understand the content of the page.”

Structured data is markup, not a browser API, so there is no per-browser support matrix to publish for it. Google Search Central documents JSON-LD, delivered as “a <script> tag in the head and body elements,” as its recommended format. schema.org defines a WebApplication type, described generically as “Web applications.”, under Thing > CreativeWork > SoftwareApplication > WebApplication — a page describing a PWA can use this type — with a browserRequirements property schema.org describes as “Specifies browser requirements in human-readable text. For example, ‘requires HTML5 support’.”

Add a JSON-LD block describing the app with schema.org’s WebApplication type:

<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "WebApplication",
"name": "My PWA",
"browserRequirements": "Requires JavaScript. Requires HTML5."
}
</script>

Per Google’s guidance, only describe content that is actually present and visible on that page — “don’t create blank or empty pages just to hold structured data, and don’t add structured data about information that is not visible to the user, even if the information is accurate.”

Before shipping, read back the JSON-LD block your own page emits and confirm it parses — this catches a malformed-JSON template bug, though it does not replace validating the markup with Google’s Rich Results Test:

function readStructuredData() {
if (!("querySelector" in document)) {
// No DOM Selectors API — nothing to read back; treat as absent.
return null;
}
const script = document.querySelector('script[type="application/ld+json"]');
if (!script) {
return null;
}
try {
return JSON.parse(script.textContent);
} catch {
// Malformed JSON-LD would fail Google's Rich Results Test — surface it
// instead of shipping markup that can't be parsed.
return null;
}
}
  • Don’t create blank or empty pages just to hold structured data, per Google Search Central’s guidelines.
  • Don’t describe information in structured data that isn’t visible to the user on that page, even if it’s accurate, per Google.
  • Validate markup with Google’s Rich Results Test before shipping — Google describes it as “an easy and useful tool for validating your structured data.”
  • MDN describes distributing a PWA as a website — not only through an app store — as what keeps it “discoverable through web search”; keep it reachable as a crawlable website too.