--- name: seo description: >- Optimize for search engine visibility and ranking. Use when the task involves `improve SEO`, `optimize for search`, `fix meta tags`, `add structured data`, `sitemap optimization`, or `search engine optimization`. license: MIT metadata: version: "1.0.0" --- # SEO optimization Search engine optimization based on Lighthouse SEO audits and Google Search guidelines. Focus on technical SEO, on-page optimization, and structured data. ## SEO fundamentals Search ranking factors (approximate influence): | Factor | Influence | This Skill | |-----------------------------------|-----------|----------------------------------------------------| | Content quality & relevance | ~40% | Partial (structure) | | Backlinks & authority | ~25% | ✗ | | Technical SEO | ~15% | ✓ | | Page experience (Core Web Vitals) | ~10% | See [Core Web Vitals](../core-web-vitals/SKILL.md) | | On-page SEO | ~10% | ✓ | --- ## Technical SEO ### Crawlability **robots.txt:** ```text # /robots.txt User-agent: * Allow: / # Block admin/private areas Disallow: /admin/ Disallow: /api/ Disallow: /private/ # Don't block resources needed for rendering # ❌ Disallow: /static/ Sitemap: https://example.com/sitemap.xml ``` **Meta robots:** ```html ``` **Canonical URLs:** ```html ``` ### XML sitemap ```xml https://example.com/ 2024-01-15 daily 1.0 https://example.com/products 2024-01-14 weekly 0.8 ``` **Sitemap best practices:** - Maximum 50,000 URLs or 50MB per sitemap - Use sitemap index for larger sites - Include only canonical, indexable URLs - Update `lastmod` when content changes - Submit to Google Search Console ### URL structure ``` ✅ Good URLs: https://example.com/products/blue-widget https://example.com/blog/how-to-use-widgets ❌ Poor URLs: https://example.com/p?id=12345 https://example.com/products/item/category/subcategory/blue-widget-2024-sale-discount ``` **URL guidelines:** - Use hyphens, not underscores - Lowercase only - Keep short (< 75 characters) - Include target keywords naturally - Avoid parameters when possible - Use HTTPS always ### HTTPS & security ```html ``` **Security headers for SEO trust signals:** ``` Strict-Transport-Security: max-age=31536000; includeSubDomains X-Content-Type-Options: nosniff X-Frame-Options: DENY ``` --- ## On-page SEO ### Title tags ```html Page Home Blue Widgets for Sale | Premium Quality | Example Store ``` **Title tag guidelines:** - 50-60 characters (Google truncates ~60) - Primary keyword near the beginning - Unique for every page - Brand name at end (unless homepage) - Action-oriented when appropriate ### Meta descriptions ```html ``` **Meta description guidelines:** - 150-160 characters - Include primary keyword naturally - Compelling call-to-action - Unique for every page - Matches page content ### Heading structure ```html

Welcome to Our Store

Products

Contact Us

Blue Widgets - Premium Quality

Product Features

Durability

Design

Customer Reviews

Pricing

``` **Heading guidelines:** - Single `

` per page (the main topic) - Logical hierarchy (don't skip levels) - Include keywords naturally - Descriptive, not generic ### Image SEO ```html Blue widget with chrome finish, side view showing control panel ``` **Image guidelines:** - Descriptive filenames with keywords - Alt text describes the image content - Compressed and properly sized - WebP/AVIF with fallbacks - Lazy load below-fold images ### Internal linking ```html Click here Read more Browse our blue widget collection Learn how to maintain your widgets ``` **Linking guidelines:** - Descriptive anchor text with keywords - Link to relevant internal pages - Reasonable number of links per page - Fix broken links promptly - Use breadcrumbs for hierarchy --- ## Structured data (JSON-LD) ### Organization ```html ``` ### Article ```html ``` ### Product ```html ``` ### FAQ ```html ``` ### Breadcrumbs ```html ``` ### Validation Test structured data at: - [Google Rich Results Test](https://search.google.com/test/rich-results) - [Schema.org Validator](https://validator.schema.org/) --- ## Additional References - Read [references/REFERENCE.md](references/REFERENCE.md) when the task needs mobile SEO, international SEO, the audit checklist, or SEO tools and references.