A unified metadata helper generates titles, descriptions, canonical URLs, Open Graph, and Twitter cards for each page
seo-nextjs-starter — Next.js Starter Template
By wangrunlin
An open-source SEO starter template built on Next.js, with built-in page metadata, sitemaps, social share images, and structured data examples that you can inspect and adapt directly.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 3
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Sitemaps and robots are generated per route, with support for local/preview noindex and explicit production URL configuration
next/og dynamically generates 1200×630 PNG social images and matching icons
Structured data examples for WebSite, SoftwareSourceCode, Article, and BreadcrumbList are provided, with JSON-LD output escaped
Includes journal and product page examples, plus bilingual Chinese and English documentation, hreflang, and redirects for the legacy README
The repository includes check scripts for ESLint, TypeScript, Node tests, production builds, and HTTP SEO assertions
Template Details
This is a Next.js starter focused on search engine optimization. The repository is MIT-licensed and authored by wangrunlin. It brings common SEO fundamentals together into a runnable example: a unified metadata helper generates titles, descriptions, canonical URLs, Open Graph, and Twitter cards for each page; sitemaps and robots are generated per route, with noindex for local/preview environments and explicit production URLs; next/og is used to generate 1200×630 PNG social images and icons; and structured data examples for WebSite, SoftwareSourceCode, Article, and BreadcrumbList are provided, with JSON-LD escaped on output.
The template includes inspectable example content: a journal with static articles and dynamic metadata, and a product page with a publishing checklist. Documentation provides bilingual Chinese and English routes, with reciprocal hreflang and redirects for the legacy README. The interface supports light and dark themes, keyboard navigation, and an interactive SEO preview. The repository also includes repeatable check scripts for ESLint, TypeScript, Node tests, production builds, and SEO assertions against actual HTTP responses.
When using it, you need to set environment variables such as site name, title, description, and production domain yourself, and update the sitemap when adding or removing pages. The README explicitly states that this is a set of SEO fundamentals and does not promise rankings or specific performance scores; the homepage preview is illustrative only, and search engines may rewrite titles and snippets. Third-party assets such as demo images, fonts, and icons must be checked separately under their respective licenses, and external services such as domains and hosting may incur additional charges.
Is it right for your project?
Use Cases
- Setting up SEO fundamentals including metadata, sitemaps, and social share images for a new site
- Learning how to write page-level metadata, dynamic OG images, and structured data in Next.js
- Using the example journal and product page as references to adapt to your own content and routes
- Verifying responses such as canonical, sitemap, robots, and redirects with the repository's built-in HTTP check scripts before deployment
- Starting a site that needs bilingual Chinese and English routes and hreflang configuration
Suitable For
- Developers using Next.js who want to centrally manage page SEO metadata
- Teams that need runnable, inspectable SEO examples rather than pure documentation
- Projects preparing to deploy on Vercel and configure a production domain themselves
- Users who want to modify and distribute based on MIT-licensed code
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Requires Node.js 22.x and pnpm 11.24.0, then run pnpm install --frozen-lockfile
- 2
Copy .env.example to .env.local and set NEXT_PUBLIC_SITE_NAME, NEXT_PUBLIC_TITLE, NEXT_PUBLIC_DESCRIPTION, and NEXT_PUBLIC_URL
- 3
NEXT_PUBLIC_URL must be a pure HTTP(S) origin without path, query, or credentials; configure the real production domain before publishing
- 4
When adding or removing pages, update src/app/sitemap.ts accordingly, and modify src/config.ts, example content, and author card as needed
- 5
After deployment, check /sitemap.xml, /robots.txt, and /api/og, and confirm canonical and social tags in the rendered HTML
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.
Must comply with when using
- You may use, modify, commercialize, and distribute the code of this version for free.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Running the example requires no account, database, or analytics service; however, production deployment requires you to configure a domain and hosting yourself, which may incur external service costs.
- Google Analytics is optional and requires your own GA measurement ID; if not set, analytics is disabled.
- You must configure a real production domain (NEXT_PUBLIC_URL) before publishing, otherwise canonical URLs and sitemaps cannot be generated correctly.
- When adding or removing pages, you must manually update sitemap.ts accordingly, otherwise the sitemap will not match the actual routes.
- When using or distributing, you must retain the copyright and license notice under the MIT license.
- Demo images, fonts, icons, and other third-party assets must be checked under their respective licenses; you cannot judge solely based on the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
No account, database, or analytics service is needed to run the examples.
Original README
Optional: your own GA measurement ID; leave unset to disable analytics
Original README
Configure your real production domain before publishing.
Original README
When adding or removing pages, also update `src/app/sitemap.ts`.
Original README
https://github.com/wangrunlin/seo-nextjs-starter/blob/main/LICENSEhttps://github.com/wangrunlin/seo-nextjs-starter/blob/main/README.mdkeep the copyright and license notice as required by the MIT license.
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-03. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 87 / 100
- Technologies
- Next.js · React
- Website type
- Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-09-11
- Screenshot last checked
- 2026-10-03
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: c12ae2cf446d0ff8cbc9c06fa4d2aabca48da1af58d99beb7d7881219362d51d
2026-10-03T00:44:13.373Z
Source file / repository# SEO Next.js Starter [](README-zh.md) [](README.md) [![GitHub][GitHub]][GitHub URL] [![GitHub stars][Stars]][Stars URL] [![GitHub forks][Forks]][Forks URL] [![GitHub issues][Issues]][Issues URL] [![GitHub license][License]][License URL] [![Last Commit][Last Commit]][Last Commit URL] [![use this template][Use This Template]][Use This Template URL] [![Deploy with Vercel][Deploy with Vercel]][Deploy with Vercel URL] A head start for your next search result. An open-source Next.js starter with page metadata, sitemaps, social images, and practical examples you can inspect and adapt. [Live demo](https://seo-nextjs.alin.run) · [Documentation](https://seo-nextjs.alin.run/docs) · [Examples](https://seo-nextjs.alin.run/examples) · [Vercel template](https://vercel.com/templates/next.js/seo-starter) [](https://seo-nextjs.alin.run) ## What ships with v1 - **Page-specific SEO:** titles, descriptions, canonical URLs, Open Graph, and Twitter cards through one metadata helper. - **Production-aware indexing:** route-based sitemap, robots, local/Preview noindex, and an explicit production URL. - **Dynamic social images:** 1200 × 630 PNG images generated with `next/og`, plus a matching icon. - **Inspectable examples:** a journal with static articles and dynamic metadata, plus a product page with a working launch checklist. - **Structured data:** WebSite, SoftwareSourceCode, Article, and BreadcrumbList examples with escaped JSON-LD output. - **Bilingual documentation:** English and Chinese routes with reciprocal hreflang, working legacy README redirects, and readable code blocks. - **Responsive design:** light/dark themes, keyboard navigation, interactive SEO previews, and author project cards. - **Repeatable checks:** ESLint, TypeScript, Node tests, production build, and HTTP SEO assertions in GitHub Actions. Built with **Next.js 16, React 19, TypeScript 5, Tailwind CSS 4, Node.js 22, and pnpm 11**. This is a set of SEO foundations, not a promise of rankings or a particular performance score. ## Quickstart Create a repository with the **Use this template** button above, then clone your new repository: ```bash # Node.js 22.x; install pnpm 11.24.0 if needed npm install --global [email protected] pnpm install --frozen-lockfile cp .env.example .env.local pnpm dev ``` Open [localhost:3000](http://localhost:3000). No account, database, or analytics service is needed to run the examples. ## Site configuration Set these in `.env.local` for development and in your deployment environment for production: ```dotenv NEXT_PUBLIC_SITE_NAME="Your site" NEXT_PUBLIC_TITLE="Your page title" NEXT_PUBLIC_DESCRIPTION="A useful description of your website." NEXT_PUBLIC_URL="https://example.com" # Optional: set false to opt out of indexing # NEXT_PUBLIC_INDEXABLE="false" # Optional: your own GA measurement ID; leave unset to disable analytics # NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-XXXXXXXXXX" ``` `NEXT_PUBLIC_URL` must be an HTTP(S) origin without a path, query, or credentials. Configure your real production domain before publishing. If omitted, Vercel deployments resolve their own project domain; local development falls back to `http://localhost:3000`. Preview deployments remain noindex even when the production URL is configured. Noindex pages allow crawling so robots can read that directive. Add a page's metadata in its server component: ```tsx import { pageMetadata } from "@/lib/seo"; export const metadata = pageMetadata( "About us", "/about", "Learn about the people and ideas behind our website.", ); ``` When adding or removing pages, also update `src/app/sitemap.ts`. Customize `src/config.ts`, the examples, and the author cards for your own project. The homepage preview is illustrative; search engines can rewrite titles and snippets. ## Deploy on Vercel [![Deploy with Vercel][Deploy with Vercel]][Deploy with Vercel URL] 1. Create your own repository and Vercel project with the button. 2. Set `NEXT_PUBLIC_URL` to your production origin and customize your site name, title, and description. Add your custom domain in Vercel if using one. 3. Deploy, then inspect `/sitemap.xml`, `/robots.txt`, and `/api/og`. Check the rendered HTML for canonical and social tags. 4. After changing environment variables, redeploy. Keep Preview deployments noindex; do not copy the demo's domain or analytics ID into your project. The maintained demo is [seo-nextjs.alin.run](https://seo-nextjs.alin.run); the existing [Vercel demo URL](https://seo-nextjs-starter.vercel.app) also remains available. The [marketplace listing](https://vercel.com/templates/next.js/seo-starter) is maintained separately from Git deployments. ## Check your changes ```bash pnpm check # lint, route types, TypeScript, tests, production build pnpm start # in a second terminal pnpm test:seo # checks actual HTTP responses at localhost:3000 # Optional: SEO_CHECK_URL=https://your-site.com pnpm test:seo ``` The HTTP checks cover example routes, canonical and sharing metadata, document language alternates, sitemap/robots, PNG assets, redirects, 404 responses, and the bundled author links. Adapt the route and author-link expectations when you customize the template. See [migration notes](MIGRATION.md) and the [changelog](CHANGELOG.md) when upgrading from 0.2.x. ## Project map | Path | Purpose | | --------------------------------- | ------------------------------------ | | `src/config.ts` | Site identity and resolved URL | | `src/lib/seo.ts` | Page metadata and breadcrumb helpers | | `src/app/sitemap.ts`, `robots.ts` | Discovery and indexing policy | | `src/app/api/og/route.tsx` | Dynamic social PNG | | `src/content/articles.ts` | Journal example content | | `src/content/docs.*.md` | Bilingual website documentation | | `tests/`, `scripts/check-seo.mjs` | Configuration and HTTP checks | ## Projects from the Author A few other tools and creative experiments by [Leo Wang](https://alin.run): - [Toolbox Hub](https://toolbox-hub.com) — Free online tools. - [H3Run](https://h3run.com) — AI video creation. - [H3MaxLive](https://h3maxlive.com) — Interactive AI video. - [Image 2.5](https://image-2-5.com) — AI image creation and editing. These are author projects, not claims that they use this starter. You can remove or replace the showcase in your own site; keep the copyright and license notice as required by the MIT license. ## Share what you build Have a project built with this template? [Submit your website](https://github.com/wangrunlin/seo-nextjs-starter/issues/new?template=submit-website.yml) or [report an issue](https://github.com/wangrunlin/seo-nextjs-starter/issues). Contributions are welcome; run the checks and keep changes focused. Commit messages follow this public repository's English Conventional Commits style. ## License [MIT](LICENSE). Free to use, modify, and build on. [Stars]: https://img.shields.io/github/stars/wangrunlin/seo-nextjs-starter?style=for-the-badge [Stars URL]: https://github.com/wangrunlin/seo-nextjs-starter/stargazers [Forks]: https://img.shields.io/github/forks/wangrunlin/seo-nextjs-starter?style=for-the-badge [Forks URL]: https://github.com/wangrunlin/seo-nextjs-starter/forks [Issues]: https://img.shields.io/github/issues/wangrunlin/seo-nextjs-starter?style=for-the-badge [Issues URL]: https://github.com/wangrunlin/seo-nextjs-starter/issues [License]: https://img.shields.io/github/license/wangrunlin/seo-nextjs-starter?style=for-the-badge [License URL]: https://github.com/wangrunlin/seo-nextjs-starter/blob/main/LICENSE [Last Commit]: https://img.shields.io/github/last-commit/wangrunlin/seo-nextjs-starter?style=for-the-badge [Last Commit URL]: https://github.com/wangrunlin/seo-nextjs-starter/commits/main [GitHub]: https://img.shields.io/badge/GitHub-wangrunlin%2Fseo--nextjs--starter-blue?style=for-the-badge&logo=github [GitHub URL]: https://github.com/wangrunlin/seo-nextjs-starter [Use This Template]: https://img.shields.io/badge/Use_this_template-Click_here-brightgreen?style=for-the-badge [Use This Template URL]: https://github.com/new?template_name=seo-nextjs-starter&template_owner=wangrunlin [Deploy with Vercel]: https://vercel.com/button [Deploy with Vercel URL]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwangrunlin%2Fseo-nextjs-starter&env=NEXT_PUBLIC_URL [Preview URL]: https://seo-nextjs.alin.run/ [Vercel Environment Variables]: https://vercel.com/docs/projects/environment-variables [Next.js Metadata Documentation]: https://nextjs.org/docs/app/api-reference/file-conventions/metadata [Open Graph Image Generation Documentation]: https://vercel.com/docs/functions/og-image-generation [Ahrefs SEO Guide]: https://ahrefs.com/seo
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
