schemamarkup.wikiThe schema.org and structured data reference

Where markup goes on a page

From schemamarkup.wiki, the sourced reference on schema.org and structured data

Structured data describes the page it sits on. Google's introduction says structured data "is coded using in-page markup on the page that the information applies to," and that it "describes the content of that page."[1] This page collects Google's rules on where markup goes and how it may be generated.

On the page it describes

Google's general guidelines say to put the structured data on the page that it describes, unless the documentation for a feature says otherwise.[2] If a site has duplicate pages for the same content, Google recommends placing the same structured data on all the duplicates, not only on the canonical page.[2] Google also says not to create blank or empty pages just to hold structured data.[1]

For organization details Google recommends the home page or a single page that describes the organization, such as an about page, and says the markup does not need to appear on every page of the site.[3]

Visible content

Google's quality guidelines say: "Don't mark up content that is not visible to readers of the page." Its example is that if the JSON-LD describes a performer, the HTML body must describe the same performer.[2] The introduction adds that markup should not describe information that is not visible to the user, "even if the information is accurate."[1] See Google's structured data guidelines.

Access for crawlers

Google's technical guidelines say not to block structured data pages from Googlebot with robots.txt, noindex or any other access control.[2] The Rich Results Test fetches pages as Google-InspectionTool, without the user's credentials, so it can be blocked by robots.txt, and pages behind a firewall or password are not available to it.[4]

JavaScript and tag managers

Google's JavaScript documentation describes generating JSON-LD with JavaScript, including through Google Tag Manager, and says Google Search "can understand and process structured data that's available in the DOM when it renders the page."[5] With a tag manager, Google recommends using variables to pull the information from the page rather than duplicating it, because duplication "increases the risk of having a mismatch between page content and the structured data."[5] Sites using server-side rendering can include the structured data in the rendered output.[5]

Google cautions merchants that dynamically generated markup can make Shopping crawls less frequent and less reliable, which matters for fast-changing product availability and price.[5] For a structured data type the Rich Results Test does not support, Google says to check the rendered HTML: if it contains the structured data, Google Search will be able to process it.[5]

Content management systems

Google notes that users of a content management system may not be able to edit HTML directly; the system may have a search engine settings page or an add-on for specifying structured data.[1] Whatever produces the markup, the same guidelines apply.[2]

Common questions

Can structured data go in the page footer or head?

Google's guidelines are about which page the markup is on and what it describes: it must be on the page it describes and describe content visible to readers.[2][1]

Does Google read JSON-LD added by JavaScript?

Yes, if it is in the DOM when Google renders the page.[5]

References

  1. ^ "Introduction to structured data markup in Google Search". Google Search Central.
  2. ^ "General structured data guidelines". Google Search Central.
  3. ^ "Organization (Organization) structured data". Google Search Central.
  4. ^ "Rich Results Test (Search Console Help)". Google Search Console Help.
  5. ^ "Generate structured data with JavaScript". Google Search Central.