MCPcopy Index your code
hub / github.com/garmeeh/next-seo

github.com/garmeeh/next-seo @7.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 7.2.0 ↗ · + Follow
474 symbols 1,082 edges 243 files 3 documented · 1% updated 4mo agonext-seo@7.2.0 · 2026-02-15★ 8,4872 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Outrank

Get traffic and outrank competitors with Backlinks & SEO-optimized content while you sleep! I've been keeping a close eye on this new tool and it seems to be gaining a lot of traction and delivering great results. Try it now!

image

Have you seen the new Next.js newsletter?

NextjsWeekly banner

Next SEO

npm npm version TypeScript License

Next SEO is a plugin that makes managing your SEO easier in Next.js projects. It provides components for structured data (JSON-LD) that helps search engines understand your content better.

📋 Table of Contents

Looking for v6 documentation? View Here

Still using component in Pages? View docs here [/src/pages/README.md]

🚀 Quick Start

Installation

npm install next-seo
# or
yarn add next-seo
# or
pnpm add next-seo
# or
bun add next-seo

Basic Usage

import { ArticleJsonLd } from "next-seo";

export default function BlogPost() {
  return (
    <>
      <ArticleJsonLd
        headline="Getting Started with Next SEO"
        datePublished="2024-01-01T08:00:00+00:00"
        author="John Doe"
        image="https://example.com/article-image.jpg"
        description="Learn how to improve your Next.js SEO"
      />
      <article>
        <h1>Getting Started with Next SEO</h1>
        {/* Your content */}
      </article>
    </>
  );
}

Note: For standard meta tags (<meta>, <title>), use Next.js's built-in generateMetadata function.

Pages Router Support: If you're using Next.js Pages Router, import components from next-seo/pages. See the Pages Router documentation for details.

Support This Project

Feel like supporting this free plugin?

It takes a lot of time to maintain an open source project so any small contribution is greatly appreciated.

Coffee fuels coding ☕️

Buy Me A Coffee

Components

ArticleJsonLd

The ArticleJsonLd component helps you add structured data for articles, blog posts, and news articles to improve their appearance in search results.

Basic Usage

import { ArticleJsonLd } from "next-seo";

export default function ArticlePage() {
  return (
    <>
      <ArticleJsonLd
        headline="My Amazing Article"
        datePublished="2024-01-01T08:00:00+08:00"
        author="John Doe"
        image="https://example.com/article-image.jpg"
        description="This article explains amazing things about Next.js SEO"
      />
      <article>
        <h1>My Amazing Article</h1>
        {/* Article content */}
      </article>
    </>
  );
}

Advanced Example with Multiple Authors

<ArticleJsonLd
  type="NewsArticle"
  headline="Breaking: Next SEO v7 Released"
  url="https://example.com/news/next-seo-v7"
  datePublished="2024-01-01T08:00:00+08:00"
  dateModified="2024-01-02T10:00:00+08:00"
  author={[
    {
      "@type": "Person",
      name: "Jane Smith",
      url: "https://example.com/authors/jane",
    },
    "John Doe", // Can mix objects and strings
  ]}
  image={[
    "https://example.com/images/16x9.jpg",
    "https://example.com/images/4x3.jpg",
    "https://example.com/images/1x1.jpg",
  ]}
  publisher={{
    "@type": "Organization",
    name: "Example News",
    logo: "https://example.com/logo.png",
  }}
  isAccessibleForFree={true}
/>

Blog Posting Example

<ArticleJsonLd
  type="BlogPosting"
  headline="10 Tips for Better SEO"
  url="https://example.com/blog/seo-tips"
  datePublished="2024-01-01T08:00:00+08:00"
  author={{
    "@type": "Organization",
    name: "SEO Experts Inc.",
    url: "https://example.com",
  }}
  image={{
    "@type": "ImageObject",
    url: "https://example.com/blog-hero.jpg",
    width: 1200,
    height: 630,
    caption: "SEO Tips Illustration",
  }}
  description="Learn the top 10 tips to improve your website's SEO"
  mainEntityOfPage={{
    "@type": "WebPage",
    "@id": "https://example.com/blog/seo-tips",
  }}
/>

Props

Property Type Description
type "Article" \| "NewsArticle" \| "BlogPosting" \| "Blog" The type of article. Defaults to "Article"
headline string Required. The headline of the article
url string The canonical URL of the article
author string \| Person \| Organization \| Author[] The author(s) of the article
datePublished string ISO 8601 date when the article was published
dateModified string ISO 8601 date when the article was last modified
image string \| ImageObject \| (string \| ImageObject)[] Article images. Google recommends multiple aspect ratios
publisher Organization The publisher of the article
description string A short description of the article
isAccessibleForFree boolean Whether the article is accessible for free
mainEntityOfPage string \| WebPage Indicates the article is the primary content of the page
scriptId string Custom ID for the script tag
scriptKey string Custom key prop for React

Best Practices

  1. Always include images: Google strongly recommends including high-resolution images with multiple aspect ratios (16x9, 4x3, 1x1)
  2. Use ISO 8601 dates: Include timezone information for accuracy
  3. Multiple authors: List all authors when applicable
  4. Publisher logo: Include a logo for NewsArticle type
  5. Update dateModified: Keep this current when updating content

↑ Back to Components

ClaimReviewJsonLd

The ClaimReviewJsonLd component helps you add structured data for fact-checking articles that review claims made by others. This enables a summarized version of your fact check to display in Google Search results.

Basic Usage

import { ClaimReviewJsonLd } from "next-seo";

export default function FactCheckPage() {
  return (
    <>
      <ClaimReviewJsonLd
        claimReviewed="The world is flat"
        reviewRating={{
          ratingValue: 1,
          bestRating: 5,
          worstRating: 1,
          alternateName: "False",
        }}
        url="https://example.com/fact-check/flat-earth"
        author="Fact Check Team"
      />
      <article>
        <h1>Fact Check: The World is Flat</h1>
        {/* Your fact check content */}
      </article>
    </>
  );
}

Props

Property Type Description
claimReviewed string Required. A short summary of the claim being evaluated (keep under 75 characters)
reviewRating object Required. The assessment of the claim with rating value and textual rating
url string Required. Link to the page hosting the full fact check article
author string \| Organization \| Person The publisher of the fact check article
itemReviewed Claim Detailed information about the claim being reviewed
scriptId string Custom ID for the script tag
scriptKey string Custom key for script identification

Review Rating Properties

Property Type Description
alternateName string Required. The truthfulness rating as human-readable text (e.g., "False", "Mostly true")
ratingValue number Required. Numeric rating (closer to bestRating = more true)
bestRating number Best value in the rating scale (must be greater than worstRating)
worstRating number Worst value in the rating scale (minimum value of 1)
name string Alternative to alternateName (use alternateName instead)

Advanced Example with Claim Details

<ClaimReviewJsonLd
  claimReviewed="Climate change is not real"
  reviewRating={{
    ratingValue: 1,
    bestRating: 5,
    worstRating: 1,
    alternateName: "Pants on Fire",
  }}
  url="https://example.com/fact-check/climate-denial"
  author={{
    name: "Climate Facts Organization",
    url: "https://example.com",
    logo: "https://example.com/logo.jpg",
  }}
  itemReviewed={{
    author: {
      name: "Climate Denial Institute",
      sameAs: "https://climatedenial.example.com",
    },
    datePublished: "2024-06-20",
    appearance: {
      url: "https://example.com/original-claim",
      headline: "The Great Climate Hoax",
      datePublished: "2024-06-22",
      author: "John Doe",
      publisher: {
        name: "Denial News",
        logo: "https://example.com/denial-logo.jpg",
      },
    },
  }}
/>

Best Practices

  1. Clear ratings: Use descriptive alternateName values that clearly indicate the verdict
  2. Claim summary: Keep claimReviewed concise (under 75 characters) to prevent wrapping
  3. Full context: Include itemReviewed when possible to provide claim origin details
  4. Consistent scale: Use a consistent rating scale across all your fact checks
  5. Author credibility: Clearly identify your fact-checking organization

↑ Back to Components

CreativeWorkJsonLd

The CreativeWorkJsonLd component helps you add structured data for various types of creative content, with special support for marking paywalled or subscription-based content. This enables Google to differentiate paywalled content from cloaking practices.

Basic Usage

import { CreativeWorkJsonLd } from "next-seo";

export default function ArticlePage() {
  return (
    <>
      <CreativeWorkJsonLd
        type="Article"
        headline="Premium Article"
        datePublished="2024-01-01T08:00:00+08:00"
        author="John Doe"
        description="This premium article requires a subscription"
        isAccessibleForFree={false}
        hasPart={{
          isAccessibleForFree: false,
          cssSelector: ".paywall",
        }}
      />
      <article>
        <h1>Premium Article</h1>


Free preview content here...





          Premium content that requires subscription...



      </article>
    </>
  );
}

Props

Property Type Description
type "CreativeWork" \| "Article" \| "NewsArticle" \| "Blog" \| "BlogPosting" \| "Comment" \| ... The type of creative work. Defaults to "CreativeWork"
headline string The headline of the content (used for Article types)
name string The name of the content (alternative to headline)
url string URL of the content
author

Extension points exported contracts — how you extend this code

Place (Interface)
(no doc)
src/types/event.types.ts
OpenGraphMedia (Interface)
(no doc)
src/pages/types/index.ts
JsonLdScriptProps (Interface)
(no doc)
src/core/JsonLdScript.tsx
PodcastEpisode (Interface)
(no doc)
examples/app-router-showcase/components/custom/PodcastSeriesJsonLd.tsx
Offer (Interface)
(no doc)
src/types/event.types.ts
OpenGraphVideoActors (Interface)
(no doc)
src/pages/types/index.ts
PodcastSeriesJsonLdProps (Interface)
(no doc)
examples/app-router-showcase/components/custom/PodcastSeriesJsonLd.tsx
PerformingGroup (Interface)
(no doc)
src/types/event.types.ts

Core symbols most depended-on inside this repo

processSchemaType
called by 73
src/utils/processors.ts
isString
called by 42
src/utils/processors.ts
processAuthor
called by 32
src/utils/processors.ts
processImage
called by 31
src/utils/processors.ts
generateSeoTags
called by 23
src/pages/core/buildTags.tsx
processAggregateRating
called by 15
src/utils/processors.ts
hasType
called by 14
src/utils/processors.ts
processAddress
called by 14
src/utils/processors.ts

Shape

Function 264
Interface 210

Languages

TypeScript100%

Modules by API surface

src/utils/processors.ts98 symbols
src/types/common.types.ts33 symbols
src/types/softwareApplication.types.ts27 symbols
src/pages/types/index.ts19 symbols
src/types/creativework.types.ts13 symbols
src/types/localbusiness.types.ts11 symbols
src/types/product.types.ts9 symbols
src/types/jobposting.types.ts9 symbols
src/types/carousel.types.ts8 symbols
src/types/howto.types.ts7 symbols
src/types/dataset.types.ts7 symbols
src/types/course.types.ts7 symbols

Dependencies from manifests, versioned

@changesets/cli2.29.7 · 1×
@eslint/eslintrc3 · 1×
@eslint/js9.38.0 · 1×
@playwright/test1.56.1 · 1×
@testing-library/react16.3.0 · 1×
@types/node24.8.1 · 1×
@types/react19.2.2 · 1×
@types/react-dom19 · 1×
@vitejs/plugin-react5.0.4 · 1×
@vitest/coverage-v83.2.4 · 1×
ajv8.17.1 · 1×

For agents

$ claude mcp add next-seo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact