--- name: "algo-seo-schema" description: "Implement Schema.org structured data markup in JSON-LD format for enhanced search results. Use this skill when the user needs to add rich snippets to web pages, implement FAQ/Product/Article schema, or validate structured data — even if they say 'rich snippets', 'structured data', or 'Google rich results'." metadata: category: "WP-35 SEO 演算法" tags: ["seo", "schema-org", "json-ld", "structured-data"] --- # Schema.org Structured Data ## Overview Schema.org structured data provides machine-readable page context to search engines via JSON-LD. Enables rich results (stars, FAQs, breadcrumbs, product cards) in SERPs. Implementation is O(1) per page — it's a markup task, not computational. ## When to Use **Trigger conditions:** - Adding rich snippet eligibility to web pages - Implementing product, article, FAQ, HowTo, or event markup - Debugging Google Search Console structured data errors **When NOT to use:** - When optimizing page content or keywords (use content SEO) - When improving page speed (use Core Web Vitals optimization) ## Algorithm ``` IRON LAW: Schema Markup Must MATCH Visible Content Marking up content that users can't see violates Google guidelines and risks manual penalties. Every structured data field must correspond to content visible on the page. ``` ### Phase 1: Input Validation Identify page type (Article, Product, FAQ, HowTo, Event, etc.). Map visible content to required and recommended schema properties. **Gate:** Page type identified, all required properties have visible content. ### Phase 2: Core Algorithm 1. Select the correct Schema.org type from the vocabulary 2. Map page content to schema properties (name, description, image, etc.) 3. Build JSON-LD object with @context and @type 4. Handle nested types (e.g., Product contains Offer contains Price) 5. Place JSON-LD in `