
On this page
Most Next.js SEO guides stop at "add a title and a sitemap". This one is the checklist I actually went through for this site, a Next.js 16 portfolio with a blog and case studies, with the code for each item and what Google Search Console reported once the site was live.
1. One metadata helper for every page
Every page.tsx exports its metadata through one small helper, so no page can forget its canonical URL, Open Graph image or Twitter card:
export const metadata = createMetadata({
title: "About Muhammad Ahmad | Full-Stack MERN Engineer",
absoluteTitle: true,
description: "…",
path: "/about",
});metadataBaseis set once in the root layout, so relative paths like/aboutbecome full canonical andog:urlvalues.- Title template:
%s | Muhammad Ahmad. Pages with a hand-written title useabsoluteTitleso the name isn't added twice. - Length limits are enforced by the build. For blog posts and case studies, a
seo.titleover 60 characters or a description over 160 failsnext build. - Unique titles and descriptions: I crawled every URL in the sitemap with a small script and checked for duplicates.
2. Canonical URLs on every page
alternates.canonical comes from the same path the helper receives. Blog posts point to themselves, which also matters if you cross-post them to Dev.to or Medium: set the canonical there to your own URL so Google credits your site.
3. Icons through file conventions
Instead of an icons object in metadata, the files live in app/ and Next.js generates the tags: favicon.ico (48×48), icon.png (512×512) and apple-icon.png (180×180). Google shows a favicon in search results only if it is a multiple of 48px and crawlable. Expect it to appear days or weeks after the page itself is indexed.
4. A default Open Graph image
A 1200×630 PNG is the fallback for every page; posts and case studies use their own 1200×630 cover. Without it, a shared link on LinkedIn or WhatsApp shows a blank card.
5. sitemap.ts generated from the content
The sitemap reads the same loader as the blog, so a new post is listed automatically. lastModified is the post's real updatedAt (not new Date(), which would tell Google every page changed on every build), and each entry lists its cover image:
const postEntries = posts.map((post) => ({
url: url(postPath(post.slug)),
lastModified: post.updatedAt,
changeFrequency: "monthly",
priority: 0.7,
images: [url(post.coverImage.src)],
}));6. robots.ts
export default function robots(): MetadataRoute.Robots {
return {
rules: { userAgent: "*", allow: "/", disallow: "/api/" },
sitemap: `${SITE_CONFIG.url}/sitemap.xml`,
};
}7. JSON-LD that matches the page
Structured data is rendered by one Server Component that escapes <, so the JSON can never close the script tag early:
export function JsonLd({ data }: { data: Record<string, unknown> }) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data).replace(/</g, "\\u003c") }}
/>
);
}- Home:
PersonandWebSite, linked by a shared@idso every other page can refer to the same person. - About:
ProfilePagewith thePersonasmainEntity. - Posts:
BlogPosting. Case studies:Article. Both withBreadcrumbList, built from the same items as the visible breadcrumb trail. - Services, projects, contact:
WebPage,CollectionPageandContactPage. - No
FAQPage: Google only shows FAQ rich results for a small set of authoritative government and health sites, so it adds nothing here.
Rule I follow: schema only describes what is visible on the page. No invented ratings, reviews or prices.
8. One H1 per page that says what the page is
The crawl script also counted headings. Every URL has exactly one <h1>. On the home page that meant merging a greeting and a separate role heading into a single H1, so the main heading names both the person and the job.
9. Speed and the rest of Lighthouse
Core Web Vitals are a small ranking signal, but slow pages also lose visitors. Locally, the main pages score 100 for SEO, Accessibility and Best Practices in Lighthouse. The performance work is its own story: from 79 to 99 on Lighthouse. Security headers (Strict-Transport-Security, X-Content-Type-Options, Referrer-Policy) are set in next.config.ts; they aren't a ranking factor, but they protect visitors and Lighthouse checks some of them under Best Practices.
10. Search Console: what happened after launch
- Verified the domain property with a DNS TXT record at the domain registrar. A domain property covers
http,https,wwwand every subdomain in one place. - Submitted
sitemap.xml. Status: *Sitemap processed successfully*, 21 discovered pages, on the same day. - Inspected the home page: *URL is on Google*, crawled as Googlebot smartphone, with the user-declared canonical matching the Google-selected one.
- Ran a live test on the main pages and requested indexing. Each returned *URL is available to Google*.
The live tests also confirmed the structured data: /about showed Profile page: 1 valid item and /case-studies showed Breadcrumbs: 1 valid item. Pages with WebPage or ItemList schema show "URL has no enhancements", which is normal: Google has no rich result for those types.
The check that fooled me
Before Search Console was set up, I checked the live site with curl and got 403. The response header said x-vercel-mitigated: challenge: the host's bot protection was challenging my script. It looked like Google might be blocked too.
It wasn't. The URL Inspection live test reported *Page fetch: Successful* and *Crawl allowed: Yes* on every page. Bot protection treats a random script differently from Googlebot. So don't judge crawlability with curl or a third-party SEO tool; use URL Inspection → Test live URL, which fetches the page the way Google does.
The checklist
| Item | Where in Next.js 16 | How to verify |
|---|---|---|
| Unique title (≤ 60) and description (≤ 160) | metadata / generateMetadata | Crawl the sitemap, check duplicates and length |
| Canonical URL | metadataBase + alternates.canonical | View source, compare with the URL |
| Favicon 48px multiple | app/favicon.ico, app/icon.png | Open /favicon.ico, check the <link rel="icon"> tags |
| OG image 1200×630 | openGraph.images | Share the link in a chat app, or check og:image |
| Sitemap with real dates | app/sitemap.ts | Search Console → Sitemaps |
| robots.txt | app/robots.ts | Open /robots.txt |
| JSON-LD matching the page | A <JsonLd> Server Component | Rich Results Test, URL Inspection |
| One H1 per page | Page components | Crawl script or browser extension |
| Crawlable by Google | Hosting / firewall settings | URL Inspection → Test live URL |
Two optional extras: an llms.txt file for AI assistants, and making sure your LCP image is loaded the right way after the Next.js 16 priority → preload change.
Frequently asked questions
Is Next.js good for SEO?
Yes. Pages are rendered to HTML on the server or at build time, and the Metadata API, sitemap.ts and robots.ts cover the technical basics. Rankings still depend on content quality and links.
How do I add a sitemap in Next.js 16?
Create app/sitemap.ts that returns an array of URLs. Use each page's real last-modified date instead of new Date(), then submit /sitemap.xml in Google Search Console.
How do I add JSON-LD in the Next.js App Router?
Render a <script type="application/ld+json"> from a Server Component with JSON.stringify(data), and escape "<" so the JSON can't close the script tag. Only describe what is visible on the page.
How do I check that Google can crawl my Next.js site?
Use URL Inspection in Google Search Console and click Test live URL. A curl request can be blocked by bot protection even when Googlebot is allowed.
- Next.js 16
- Technical SEO
- Search Console
- JSON-LD
Keep reading
Vizlio · Web design & development agency · Australia
Vizlio: A CMS-Powered Agency Website with a Custom AI Chatbot
The website, admin panel and AI assistant for Vizlio, an Australian web design and development agency. Every page is editable from the admin panel, and a custom-trained chatbot answers visitors' questions about the business. Built solo.
- Website, admin panel and AI chatbot
- 3 in 1
- Site content editable from the admin panel
- 100%

Speed & SEO5 min read
How I Took My Next.js Portfolio from 79 to 99 on Lighthouse
Mobile LCP went from 4.4s to 0.9s. The biggest win was not images or code splitting: it was removing a fade-in animation.

Speed & SEO5 min read
How to Add llms.txt to a Next.js Site (and What It Will and Won't Do)
An llms.txt file for a Next.js App Router site, generated from the same content as the sitemap so it never goes stale. Plus an honest look at who reads llms.txt today, and why it isn't an SEO ranking factor.
