--- name: structured-data description: Schema.org Structured Data Reference — JSON-LD examples for every major schema type, rich results eligibility, testing tools, and implementation patterns version: "1.0.0" author: Cogny AI platforms: [] user-invocable: true argument-hint: "" allowed-tools: - WebFetch - WebSearch - Bash - Read - Write # Search Console tools (when connected via Cogny MCP) - mcp__cogny__search_console__tool_list_properties - mcp__cogny__search_console__tool_get_search_analytics - mcp__cogny__search_console__tool_inspect_url --- # Schema.org Structured Data Reference Complete reference for Schema.org structured data markup: JSON-LD examples, rich results eligibility, testing tools, validation, and implementation patterns for static sites, Next.js, React, and WordPress. Full docs: https://cogny.com/docs/structured-data-reference ## Usage ``` /structured-data # Full reference overview /structured-data Product # Show Product schema example /structured-data FAQPage # Show FAQPage example /structured-data LocalBusiness # Show LocalBusiness example /structured-data validate # Testing and validation guide /structured-data best-practices # Schema best practices /structured-data rich-results # Rich results eligibility table ``` ## Instructions You are a Schema.org structured data expert. Use this reference to help users write correct JSON-LD markup, choose the right schema type for their pages, validate their structured data, and implement it across different platforms. When the user asks a question, find the relevant section below and provide precise, actionable answers with ready-to-use JSON-LD examples. If the user provides a specific schema type or topic as an argument, focus on that area. Otherwise, provide an overview and help them determine which schema type they need. When Search Console MCP tools are available, use them to: - Check which pages have rich results via `tool_get_search_analytics` (filter by search appearance) - Inspect specific URLs for structured data issues via `tool_inspect_url` - List properties to identify which sites to audit via `tool_list_properties` --- ## What Structured Data Does Structured data is machine-readable markup that tells search engines, voice assistants, and AI systems exactly what your page content means. You declare it explicitly using the Schema.org vocabulary. **Benefits:** - **Rich results** — star ratings, prices, FAQ accordions, how-to steps, event listings in Google Search - **Knowledge panels** — branded panels for organizations, people, and products - **Voice search** — direct answers in Google Assistant and other voice interfaces - **AI citations** — LLMs and AI search engines (Google AI Overviews, Bing Copilot, Perplexity) use structured data to surface and attribute information ## Formats Three formats exist. Google explicitly recommends JSON-LD. ### JSON-LD (Recommended) ```html ``` **Why JSON-LD:** Decoupled from HTML, injectable by JS frameworks, easy to validate, no layout risk. ### Microdata Inline HTML attributes (`itemscope`, `itemtype`, `itemprop`). Use only in legacy systems that cannot add ` ``` ### Next.js (App Router) ```tsx export default function ProductPage({ product }) { const jsonLd = { "@context": "https://schema.org", "@type": "Product", name: product.name, image: product.images, offers: { "@type": "Offer", price: product.price, priceCurrency: product.currency, availability: product.inStock ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", }, }; return ( <> '; } }); ``` ### Dynamic CMS Pattern ```typescript function generateProductSchema(cmsData: CMSProduct): object { return { "@context": "https://schema.org", "@type": "Product", name: cmsData.title, image: cmsData.media.map(m => m.url), offers: { "@type": "Offer", price: cmsData.variants[0].price.toString(), priceCurrency: cmsData.currency, availability: cmsData.inStock ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", }, }; } ``` Key principle: generate structured data from the same data source that populates the page, never hardcode separately. ## Resources - **Schema.org Full Vocabulary:** https://schema.org/docs/full.html - **Google Rich Results Gallery:** https://developers.google.com/search/docs/appearance/structured-data/search-gallery - **Google Rich Results Test:** https://search.google.com/test/rich-results - **Schema Markup Validator:** https://validator.schema.org - **Full Cogny Docs:** https://cogny.com/docs/structured-data-reference