seo-meta-tags
Original:🇺🇸 English
Translated
Comprehensive SEO and social metadata implementation for HTML, Next.js App Router, and Vite (React & Vue) projects. Use when: (1) Creating, editing, or reviewing meta tags, Open Graph, Twitter Cards, canonical/hreflang links, JSON-LD structured data, theme-color, or favicon/manifest config; (2) Working with html/index.html, nextjs/metadata.ts, nextjs/dynamic-metadata-example.tsx, vite/index.html, vite/SEO.tsx, or vite/SEO.vue; (3) Adding SEO to a new page or route; (4) Migrating from react-helmet, vue-meta, or next-seo; (5) Generating dynamic metadata for content-driven pages; (6) Auditing metadata for completeness or best-practice compliance.
1installs
Added on
NPX Install
npx skill4agent add jeremy0x/meta-tag-boilerplate seo-meta-tagsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →SEO Meta Tags
Boilerplate and component library for production-ready metadata across three framework targets.
Decision Tree
Determine the correct framework path first:
- Static HTML site or any-backend project — Read references/html.md
- Next.js 13+ App Router — Read references/nextjs.md
- Vite + React — Read references/vite.md, React section
- Vite + Vue 3 — Read references/vite.md, Vue section
- Multiple frameworks at once — Read all relevant reference files
Then determine action type:
- Creating metadata from scratch? — Read matching reference → copy boilerplate → replace placeholders.
- Updating existing metadata? — Load file → keep structure → change requested values → verify parity across tag families.
- Auditing / reviewing metadata? — Run through Quality Gate below → report issues.
- Migrating between frameworks? — Read source reference → read target reference → map fields.
Framework Selection
| Framework | When to use | Reference |
|---|---|---|
| HTML | Static sites, any backend, SSGs | references/html.md |
| Next.js | Next.js 13+ App Router projects | references/nextjs.md |
| Vite | Vite + React or Vite + Vue apps | references/vite.md |
Read only the reference file that matches the user's target framework.
Metadata Families
Every framework target must keep parity across these families. When modifying one family, verify the others remain consistent.
1. Essential / Primary
| Tag | Constraint |
|---|---|
| Under 60 characters |
| 150-160 characters |
| 5-10 terms max, comma-separated |
| Full name |
| |
| Absolute URL, must match deployment URL |
| |
2. Open Graph (og:*
)
og:*| Property | Notes |
|---|---|
| |
| Absolute URL |
| Can differ from |
| Can differ from meta description |
| Absolute URL, 1200x630px, JPG or PNG, under 1 MB |
| |
| Required when image is present |
| Brand name |
| e.g. |
For type also include: , , , .
articlearticle:published_timearticle:modified_timearticle:authorarticle:tag3. Twitter Cards (twitter:*
)
twitter:*| Property | Notes |
|---|---|
| |
| Organization handle with |
| Author handle with |
| Under 70 characters |
| Under 200 characters |
| Same spec as OG image |
| Required when image is present |
4. Theme Color
Provide three values:
- Default: or single value
<meta name="theme-color" content="..."> - Light:
media="(prefers-color-scheme: light)" - Dark:
media="(prefers-color-scheme: dark)"
Next.js uses the array in the Metadata object.
themeColor5. Icons and Manifest
| Asset | Size | Format |
|---|---|---|
| 32x32 or multi-size | ICO |
| 16x16 | PNG |
| 32x32 | PNG |
| 180x180 | PNG |
| n/a | JSON |
Generate with favicon.io or RealFaviconGenerator.
6. Structured Data (JSON-LD)
Emit a block (HTML/Vite) or use a separate Script component in Next.js. Required keys:
<script type="application/ld+json">json
{
"@context": "https://schema.org",
"@type": "WebSite",
"name": "",
"description": "",
"url": "",
"image": { "@type": "ImageObject", "url": "", "width": 1200, "height": 630 },
"author": { "@type": "Person", "name": "" },
"publisher": {
"@type": "Organization",
"name": "",
"logo": { "@type": "ImageObject", "url": "" }
}
}Common values: , , , , , .
@typeWebSiteArticleOrganizationProductFAQPageBreadcrumbList7. Internationalization (hreflang)
html
<link rel="alternate" hreflang="en" href="https://example.com/en/" />
<link rel="alternate" hreflang="es" href="https://example.com/es/" />
<link rel="alternate" hreflang="x-default" href="https://example.com/" />Next.js equivalent: in the Metadata object.
alternates.languages8. Performance Hints
Include when external resources are used:
html
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="dns-prefetch" href="https://www.google-analytics.com" />Placeholder Tokens
All boilerplate files use tokens. Common tokens:
{{PLACEHOLDER_NAME}}| Token | Purpose |
|---|---|
| Page |
| Meta description |
| Page URL (absolute) |
| Canonical URL |
| Comma-separated keywords |
| Content author |
| Brand / site name |
| Hex color codes |
| Open Graph |
| |
| Twitter handles |
| JSON-LD |
| Publisher org |
| Icons |
| Author website URL (Next.js) |
| Content creator name (Next.js) |
| Site category (Next.js) |
| Search engine verification codes (Next.js) |
| Language-specific alternate URLs (Next.js) |
| hreflang alternate URLs (HTML/Vite) |
When implementing for a user, replace every token. Never leave placeholders in production output.
{{...}}Quality Gate
Run these checks before considering any metadata task complete:
- No placeholders — grep for in all modified files; count must be zero.
{{ - Absolute URLs — canonical, OG url, OG image, Twitter image, JSON-LD url/image must start with .
https:// - Image alt text — every /
og:imagemust have a corresponding alt field.twitter:image - No duplicate tags — no two conflicting ,
<title>, ordescriptiontags in the same scope.canonical - Title length — verify under 60 characters.
- Description length — verify 150-160 characters.
- JSON-LD validity — valid JSON with required and
@contextkeys.@type - OG/Twitter parity — if OG title is set, Twitter title should also be set (and vice versa).
- Canonical consistency — canonical URL matches the actual page URL or intended redirect target.
- Theme color — includes both light and dark media variants.
- hreflang — includes when language alternates exist.
x-default - Robots — allows indexing unless user explicitly requests noindex.
Image Specifications
| Use case | Dimensions | Ratio | Format | Max size |
|---|---|---|---|---|
| OG / Twitter | 1200x630 | 1.91:1 | JPG or PNG | 1 MB |
| Favicon 32 | 32x32 | 1:1 | PNG | n/a |
| Favicon 16 | 16x16 | 1:1 | PNG | n/a |
| Apple Touch | 180x180 | 1:1 | PNG | n/a |
Testing Tools
Recommend to users after deployment:
- Facebook Sharing Debugger
- Twitter Card Validator
- LinkedIn Post Inspector
- Open Graph Check
- Schema Markup Validator
- Google Rich Results Test
Common Mistakes
| Mistake | Impact | Fix |
|---|---|---|
Relative URLs in | Social platforms can't fetch the image | Always use absolute URLs starting with |
Missing | All | Wrap app root in |
Missing | | Call |
| Committing verification codes to public repos | Exposes site ownership tokens | Use environment variables for |
Duplicate | Crawlers pick an unpredictable one | Use only one source of truth per scope (layout vs. page) |
| Accessibility failure, some validators warn | Always pair image with alt text |
Using | Unnecessary async overhead on every request | Use static |
Leaving | Broken display on social platforms, poor SEO | Grep for |
| JSON-LD with trailing commas or comments | Invalid JSON, structured data ignored | Validate JSON before finishing |
| Image gets cropped to tiny square | Use |
Migration Paths
| From | To | Notes |
|---|---|---|
| Vite React ( | Replace with |
| Vite Vue ( | Replace |
| Next.js ( | Remove |
Pages Router | App Router | Replace |