WebPageElement
WebPageElement is a CreativeWork subtype for a component of a web page. It adds 2 direct properties:
cssSelector(CssSelectorType): a CSS selector pointing to the element.xpath(XPathType): an XPath pointing to the element.
It is the parent of SiteNavigationElement, Table, WPHeader, WPFooter, WPSideBar, WPAdBlock.
Prefer the specific subtype where it applies. Attach to WebPage via mainContentOfPage, primaryImageOfPage, or directly as a child of hasPart.
Full example of schema.org/WebPageElement json-ld markup
The markup is verified as valid with Rich Results Test from Google.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPageElement",
"name": "You may also like",
"cssSelector": "#related-products",
"xpath": "/html/body/main/section[4]"
}
</script>Minimal valid version
The smallest markup that still produces a valid WebPageElement entity. Use it as the floor. Reach for the advanced example above when you want search engines and AI agents to understand more about your content.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPageElement",
"cssSelector": "#related-products"
}
</script>Google rich results this unlocks
Markup matching this example makes your page eligible for the following Google Search rich results. The primary target drives the required / recommended property classification in the advanced code block above.
- Google docsNo dedicated rich result (accessibility / speakable surfaces)
Common WebPageElement mistakes
Mistakes that pass validation but silently fail to earn rich results or mislead consumers walking the graph. Avoid these and your markup will be ahead of most sites in the wild.
- 01
Generic WebPageElement when a subtype applies
WrongWebPageElement on a page's footerRightWPFooter for the footer; similarly for header / sidebarSubtype classification adds meaning consumers use.
Schema properties in this example
About the example data
A generic WebPageElement marking the product-recommendations strip on a Xoo Code product page.
Comments
Loading comments...