Guides · Next.js

SEO, link previews and favicons in Next.js

Three things decide how your site looks before anyone opens it: the search result, the preview card when someone pastes your link into a chat, and the little icon on a tab or home screen. A sitemap makes sure search engines find every page, and speed decides whether visitors stay. The Next.js App Router has built-in tools for all of it. This guide walks through each, with the gotchas that make them quietly fail.

19 min read

  • next.js
  • seo
  • open graph
  • favicons
  • performance

Everything here uses the App Router (app/) and works in Next.js 14 and later. Where an API changed in 15 or 16, it's called out.

How search engines and chat apps read your page

Search crawlers and link-preview bots (WhatsApp, iMessage, Slack, Discord, LinkedIn, X and the rest) fetch your page's HTML and read the tags in its head. Most preview bots never run JavaScript. If a title or image only appears after the page hydrates, those bots don't see it.

That's why the App Router's Metadata API matters: you describe the page's metadata in your server code, and Next.js writes the tags into the HTML before it leaves the server. You almost never write a meta tag by hand.

Part 1: Better SEO

Set defaults once in the root layout

Start with site-wide defaults in app/layout.tsx:

tsx
import type { Metadata, Viewport } from "next";

export const metadata: Metadata = {
metadataBase: new URL("https://example.com"),
title: {
default: "Acme",
template: "%s | Acme",
},
description: "Acme builds tools that make small teams faster.",
applicationName: "Acme",
alternates: { canonical: "/" },
openGraph: {
type: "website",
siteName: "Acme",
locale: "en_US",
url: "/",
},
twitter: { card: "summary_large_image" },
};

export const viewport: Viewport = {
themeColor: "#0f172a",
};

Four details in there do a lot of work:

  • metadataBase is the most important line. Open Graph images, canonical URLs and alternates must be absolute URLs. With metadataBase set, you can write /blog/my-post everywhere and Next.js turns it into https://example.com/blog/my-post. Without it, relative URLs fall back to a guess (localhost in development) and previews break in production.
  • title.template means a page only sets its own title ("Pricing") and gets Pricing | Acme automatically. title.default is used for pages that don't set one.
  • twitter.card: "summary_large_image" asks X (and apps that copy its behaviour) for the big image card instead of a small thumbnail.
  • themeColor lives in viewport, not metadata, since Next.js 14. It colours the browser toolbar on Android.

Give every page its own metadata

A static page exports a metadata object. A page whose content depends on the URL, like a blog post, exports generateMetadata instead:

tsx
import type { Metadata } from "next";
import { cache } from "react";

const getPost = cache(async (slug: string) => {
const res = await fetch(`https://cms.example.com/posts/${slug}`);
return res.json();
});

type Props = { params: Promise<{ slug: string }> };

export async function generateMetadata({ params }: Props): Promise<Metadata> {
const { slug } = await params;
const post = await getPost(slug);

return {
title: post.title,
description: post.excerpt,
alternates: { canonical: `/blog/${slug}` },
openGraph: {
type: "article",
title: post.title,
description: post.excerpt,
url: `/blog/${slug}`,
publishedTime: post.publishedAt,
authors: [post.author.name],
},
};
}

export default async function Page({ params }: Props) {
const { slug } = await params;
const post = await getPost(slug);
return <article>{/* … */}</article>;
}
  • params is a Promise from Next.js 15 on, so it's awaited. In 14 it was a plain object.
  • Wrapping the loader in React's cache means generateMetadata and the page share one fetch instead of making two. (Plain fetch calls are deduplicated anyway; cache also covers database queries and SDK calls.)

Watch the merge rule

Metadata from a layout and its pages is merged, but only one level deep. If the root layout sets openGraph with siteName and locale, and a page sets its own openGraph, the page's object replaces the layout's entirely: siteName and locale are gone for that page.

The fix is to keep shared fields in a constant and spread it:

ts
export const sharedOpenGraph = {
siteName: "Acme",
locale: "en_US",
type: "website" as const,
};
ts
openGraph: {
...sharedOpenGraph,
type: "article",
title: post.title,
},

Canonical URLs

The same page is often reachable at several URLs: with and without a trailing slash, with tracking parameters, through a preview deployment. A canonical URL tells search engines which one is the real page, so the others don't compete with it or count as duplicate content. Set alternates.canonical on every indexable page, as in the examples above.

For a site in several languages, list each version under alternates.languages too, so search engines show the right one to each visitor:

ts
alternates: {
canonical: "/en/pricing",
languages: {
en: "/en/pricing",
th: "/th/pricing",
},
},

robots.txt

robots.txt tells crawlers what they may fetch, and where your sitemap is. In the App Router it's a file in app/ that returns data:

ts
// app/robots.ts
import type { MetadataRoute } from "next";

export default function robots(): MetadataRoute.Robots {
return {
rules: { userAgent: "*", allow: "/", disallow: ["/api/", "/admin/"] },
sitemap: "https://example.com/sitemap.xml",
};
}

disallow stops crawling, not indexing: a blocked page can still show up in results if other sites link to it. To keep a page out of results, let it be crawled and mark it noindex instead. Don't block your Open Graph images or icons either, or previews and favicons break (see Parts 3 and 4). Sitemaps get a part of their own, Part 2.

To keep a staging or preview deployment out of search results without touching robots.txt, mark it noindex:

ts
robots: process.env.VERCEL_ENV === "production"
? { index: true, follow: true }
: { index: false, follow: false },

Structured data

Structured data (JSON-LD) describes the page in a vocabulary search engines understand: this is an article, this is its author, this is a product with this price. It's what can earn rich results like article dates, star ratings or breadcrumbs. Render it as a script tag in the page:

tsx
const jsonLd = {
"@context": "https://schema.org",
"@type": "BlogPosting",
headline: post.title,
description: post.excerpt,
datePublished: post.publishedAt,
dateModified: post.updatedAt,
author: { "@type": "Person", name: post.author.name },
image: post.coverUrl,
};

return (
<article>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(jsonLd).replace(/</g, "\\u003c"),
}}
/>
{/* … */}
</article>
);

The .replace escapes any < in your data, so a title containing </script> can't break out of the tag. Check the result with Google's Rich Results Test.

Content and speed still count

Metadata gets you described correctly; the page itself still has to be worth ranking.

  • Render the important text on the server. Server Components do this by default. Content that only appears after a client-side fetch may be indexed late or not at all.
  • One h1 per page, then h2/h3 in order. Search engines use headings to understand structure.
  • Descriptive link text. "Read the pricing guide" beats "click here".
  • Core Web Vitals feed into ranking. next/image sizes and lazy-loads images and prevents layout shift; give your hero image priority so it loads first. next/font self-hosts fonts and removes the font-swap jump.
  • Alt text on every meaningful image, for screen readers and image search alike.

Part 2: Sitemaps

A sitemap is a list of the URLs you want search engines to index, with the date each one last changed. Crawlers find most pages by following links anyway, so a sitemap matters most for:

  • New sites, which few other sites link to yet.
  • Large sites, where deep pages are many clicks from the home page.
  • Pages that change, so crawlers know which ones to fetch again.
  • Pages that nothing links to, like campaign landing pages.

A basic sitemap

Add app/sitemap.ts and Next.js serves it at /sitemap.xml:

ts
// app/sitemap.ts
import type { MetadataRoute } from "next";

const siteUrl = "https://example.com";

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const posts = await getAllPosts();

const pages: MetadataRoute.Sitemap = [
{ url: siteUrl, lastModified: "2026-11-01" },
{ url: `${siteUrl}/about`, lastModified: "2026-09-12" },
{ url: `${siteUrl}/blog`, lastModified: posts[0]?.updatedAt },
];

return [
...pages,
...posts.map((post) => ({
url: `${siteUrl}/blog/${post.slug}`,
lastModified: post.updatedAt,
})),
];
}

The function runs at build time and the result is cached like a static page. If your posts come from a CMS or database, add export const revalidate = 3600; so new posts appear within the hour, or revalidate it from the same webhook that rebuilds the post.

For a small site that rarely changes, you can skip the code and drop a hand-written app/sitemap.xml in instead.

What to put in it

A sitemap should only list pages you want in search results, exactly as you want them indexed:

  • Only canonical URLs. The same address you set in alternates.canonical, with the same trailing slash (or lack of one) and no tracking parameters.
  • Only pages that return 200. Leave out redirects, 404s and anything marked noindex. A sitemap full of URLs that don't resolve tells search engines it can't be trusted.
  • Absolute URLs on your production domain. Build them from one constant or environment variable, so a preview deployment never ships a sitemap full of localhost or preview URLs.

lastModified: make it honest

lastModified becomes the lastmod date, and it's the one field that really counts: Google uses it to decide what to recrawl, but only if it's consistently accurate. Two common mistakes defeat it:

  • lastModified: new Date() stamps every URL with the build time. Every deploy then claims every page changed, so the date stops meaning anything.
  • Bumping the date for trivial changes, like a new footer link.

Use the date the page's content really changed: the post's updatedAt from your CMS, or the file's last commit date for MDX content.

changeFrequency and priority are also valid fields, but Google has said it ignores both. Other search engines may read them; they're harmless but not worth tuning.

Images and languages

Recent versions of Next.js can add extra detail to each entry:

ts
{
url: "https://example.com/blog/launch",
lastModified: "2026-11-11",
images: ["https://example.com/blog/launch/cover.jpg"],
alternates: {
languages: {
en: "https://example.com/en/blog/launch",
th: "https://example.com/th/blog/launch",
},
},
},
  • images helps your pictures appear in image search, especially ones loaded in ways crawlers can miss.
  • alternates.languages lists each language version of the page, the sitemap equivalent of the alternates.languages metadata from Part 1. Use one or the other consistently.

Large sites: split it up

One sitemap file is limited to 50,000 URLs and 50 MB uncompressed. Past that, use generateSitemaps to produce several:

ts
// app/products/sitemap.ts
import type { MetadataRoute } from "next";

const PER_SITEMAP = 50000;

export async function generateSitemaps() {
const total = await countProducts();
const count = Math.ceil(total / PER_SITEMAP);
return Array.from({ length: count }, (_, id) => ({ id }));
}

export default async function sitemap({
id,
}: {
id: Promise<string> | string;
}): Promise<MetadataRoute.Sitemap> {
const page = Number(await id);
const products = await getProducts({
offset: page * PER_SITEMAP,
limit: PER_SITEMAP,
});

return products.map((product) => ({
url: `https://example.com/products/${product.slug}`,
lastModified: product.updatedAt,
}));
}

This serves /products/sitemap/0.xml, /products/sitemap/1.xml and so on. Depending on your Next.js version, id arrives as a plain value or as a Promise; await works for both. List every file in robots.ts so crawlers find them all:

ts
sitemap: [
"https://example.com/sitemap.xml",
"https://example.com/products/sitemap/0.xml",
"https://example.com/products/sitemap/1.xml",
],

Splitting by section (products, blog, docs) also has a side benefit: Search Console reports indexing per sitemap, so you can see at a glance which section has problems.

Submit it and check it

  1. Open it yourself. Visit /sitemap.xml on the live site and confirm the URLs are absolute, on the right domain, and that the count looks right.
  2. Reference it in robots.txt, as in Part 1. Every crawler that reads robots.txt then finds it, not only the ones you submit to.
  3. Submit it in Google Search Console under Indexing → Sitemaps, and in Bing Webmaster Tools. The report should say Success and show how many URLs were discovered.
  4. Watch the Pages report in Search Console. "Discovered – currently not indexed" or "Crawled – currently not indexed" on many sitemap URLs usually means thin or duplicate content, not a sitemap problem.

Google retired its old sitemap "ping" URL in 2023, so there's nothing to call after a deploy: an accurate lastModified and the robots.txt reference are enough.

A sitemap doesn't guarantee indexing. It's a list of suggestions; search engines still decide each page on its own merits. What it does guarantee is that none of your pages are missed for lack of a link.

Part 3: Link previews when a link is pasted

When someone pastes your link into WhatsApp, iMessage, Telegram, Slack, Discord, LinkedIn, Facebook or X, that app's bot fetches the URL and builds a card from your Open Graph tags: og:title, og:description and, most visibly, og:image. X reads its own twitter:* tags first and falls back to Open Graph.

The simplest way: an image file

Drop an image named opengraph-image.png (or .jpg) into any route folder:

text
app/
├─ opengraph-image.png ← default for the whole site
└─ blog/
└─ [slug]/
├─ page.tsx
└─ opengraph-image.tsx ← generated per post (below)

Next.js adds the og:image tags, with width, height and type, to every page in that segment and below. Add opengraph-image.alt.txt next to it for the alt text. A twitter-image.png works the same way if you want a different image on X; without one, X uses the Open Graph image.

Generating an image per page

For blog posts or products, generate the card from the page's data with ImageResponse:

tsx
// app/blog/[slug]/opengraph-image.tsx
import { ImageResponse } from "next/og";

export const alt = "Acme blog post";
export const size = { width: 1200, height: 630 };
export const contentType = "image/png";

export default async function Image({
params,
}: {
params: Promise<{ slug: string }>;
}) {
const { slug } = await params;
const post = await getPost(slug);

return new ImageResponse(
(
<div
style={{
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
justifyContent: "flex-end",
padding: 72,
background: "#0f172a",
color: "#ffffff",
}}
>
<div style={{ fontSize: 64, fontWeight: 700, lineHeight: 1.1 }}>
{post.title}
</div>
<div style={{ marginTop: 24, fontSize: 28, opacity: 0.6 }}>
example.com
</div>
</div>
),
size,
);
}

ImageResponse renders JSX to a PNG on the server. It supports a subset of CSS built around flexbox: every element with more than one child needs display: "flex", and there's no CSS grid. To use your brand font, load the font file and pass it in the fonts option.

Rules that make previews actually appear

Most "my preview doesn't show" bugs come down to one of these:

  • Size 1200 × 630. That 1.91:1 ratio is what Facebook, LinkedIn, X's large card, Slack and Discord expect, and it crops acceptably in the square-ish previews iMessage and WhatsApp show on phones. Keep text and logos away from the edges.
  • Keep the file small. A few hundred kilobytes is safe. Some apps, WhatsApp in particular, are known to skip images that are too heavy, and a big image slows every bot that fetches it. Prefer JPEG for photos; PNG for flat graphics.
  • Absolute, public HTTPS URL. Set metadataBase (see Part 1). The image must load without cookies or login, and must not be blocked by robots.txt.
  • A real image response. The URL has to return an image with the right Content-Type, not an HTML error page or a redirect to a login screen.
  • Title and description too. Without og:title and og:description some apps show a bare URL even when the image is fine. Keep titles under about 60 characters and descriptions under about 160, or they get cut off.
  • twitter:card set to summary_large_image, or X shows a small square thumbnail.

Check what the bots see

Fetch the page the way a bot does and look for the tags:

bash
curl -sL -A "facebookexternalhit/1.1" https://example.com/blog/my-post \
| grep -Eo '<meta (property|name)="(og|twitter):[^>]*>'

If the tags are missing here, no app will show a preview. Then use each platform's own checker, which also shows exactly what it will render:

"I fixed it but the old preview still shows"

Every app caches previews, often for days. After changing your tags:

  1. Run the URL through the Facebook Sharing Debugger and press Scrape Again. This refreshes Facebook, Messenger and usually WhatsApp.
  2. Use LinkedIn's Post Inspector the same way.
  3. For any other app, share the URL with a harmless query string (?v=2). To the app it's a new URL, so it fetches fresh. Your canonical tag keeps search engines pointed at the clean URL.

Streaming metadata and bots

From Next.js 15.2, generateMetadata can stream: browsers get the page right away and the metadata arrives later in the response. Bots that only read the initial HTML would miss it, so Next.js detects known preview and search bots by user agent and waits for metadata before sending anything to them. If a less common bot misses your tags, add its user agent to htmlLimitedBots in next.config.ts.

Part 4: Favicons on Android and iOS

"Favicon" now covers several icons on several surfaces: the browser tab, bookmarks, search results, and the home-screen icon when someone adds your site to their phone. Each platform looks for something different.

The file setup

Next.js turns specially named files in app/ into the right tags:

text
app/
├─ favicon.ico 32×32 (with 16×16 inside) — classic tab icon
├─ icon.svg scalable tab icon for modern browsers
├─ apple-icon.png 180×180, opaque — iPhone and iPad home screen
└─ manifest.ts Android home screen and install
public/
└─ icons/
├─ icon-192.png
├─ icon-512.png
└─ maskable-512.png
  • favicon.ico only works in the root of app/.
  • icon.* and apple-icon.* become link rel="icon" and link rel="apple-touch-icon" tags with the right sizes and type.
  • Like Open Graph images, icons can also be generated with ImageResponse from an icon.tsx or apple-icon.tsx file.

iOS: the apple-touch-icon

When someone uses Add to Home Screen on an iPhone or iPad, iOS looks for an apple-touch-icon first, so always provide one:

  • 180 × 180 PNG. iOS scales it for other devices.
  • No transparency. iOS fills transparent pixels with black, so a logo on a transparent background turns into a logo on a black square. Put it on a solid background colour.
  • Square corners. iOS rounds the corners itself. Don't pre-round them, and leave some padding around the logo.

To control the name under the icon and how the site behaves when launched from the home screen, add appleWebApp to the root metadata:

ts
appleWebApp: {
title: "Acme",
capable: true,
statusBarStyle: "default",
},

Android: the web app manifest

Chrome on Android builds the home-screen icon, the install prompt and the splash screen from the web app manifest. Create app/manifest.ts and Next.js links it from every page:

ts
import type { MetadataRoute } from "next";

export default function manifest(): MetadataRoute.Manifest {
return {
name: "Acme",
short_name: "Acme",
start_url: "/",
display: "standalone",
background_color: "#ffffff",
theme_color: "#0f172a",
icons: [
{ src: "/icons/icon-192.png", sizes: "192x192", type: "image/png" },
{ src: "/icons/icon-512.png", sizes: "512x512", type: "image/png" },
{
src: "/icons/maskable-512.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
};
}
  • 192 and 512 are the two sizes that matter. 192 for the home screen, 512 for the splash screen and install dialogs.
  • Add a maskable icon. Android launchers crop icons into circles, squircles or rounded squares depending on the phone. A normal icon gets shrunk onto a white background to survive the crop; a maskable icon is designed to be cropped. Keep the logo inside the central 80% (a circle with 40% of the width as its radius) and fill the rest with your background colour. maskable.app previews every shape.
  • short_name is what appears under the icon; keep it to about 12 characters.
  • theme_color and background_color colour the title bar and the splash screen.

Search results

Google shows your favicon next to your site in mobile and desktop results. For it to appear:

  • The icon must be square, and Google recommends it be larger than 48 × 48 (an SVG works).
  • Its URL must be crawlable (not blocked by robots.txt) and stable: don't change it on every deploy.
  • It's picked up the next time Google crawls your home page, which can take days or weeks.

Checking the icons

  • iOS: open the site in Safari, tap Share → Add to Home Screen, and look at the preview.
  • Android: open the site in Chrome; in desktop Chrome, DevTools → Application → Manifest lists every icon, flags missing sizes, and shows how the maskable icon will crop.
  • Everywhere: view the page source and confirm the link rel="icon", link rel="apple-touch-icon" and link rel="manifest" tags point at files that actually load.

Part 5: Other optimizations

Speed is part of SEO: Google uses Core Web Vitals as a ranking signal, and a slow page loses visitors before your metadata ever matters. These are the three to watch:

MetricMeasuresGood
LCPHow fast the main content appears≤ 2.5 s
INPHow quickly the page responds to input≤ 200 ms
CLSHow much the layout jumps while loading≤ 0.1

Ship less JavaScript

Every component in app/ is a Server Component unless it says otherwise. Server Components render to HTML and send no JavaScript of their own, which is the single biggest win the App Router gives you.

  • Push "use client" down to the leaves. Mark the small interactive piece (a button, a menu) as a client component, not the whole page around it. Everything it imports joins the client bundle.
  • Load heavy client-only widgets on demand. Charts, editors and maps don't need to be in the first load:
tsx
"use client";

import dynamic from "next/dynamic";

const Chart = dynamic(() => import("./Chart"), {
ssr: false,
loading: () => <p>Loading chart…</p>,
});
  • Trim barrel imports. Libraries that re-export hundreds of modules from one entry (icon sets, utility kits) can bloat a bundle. experimental.optimizePackageImports in next.config.ts makes Next.js import only what you use; many popular libraries are optimised this way by default.
  • See what's in the bundle. @next/bundle-analyzer draws a map of every module in each bundle, so the 300 KB date library hiding in your footer is easy to spot.

Images

next/image handles resizing, modern formats and lazy loading, but it needs a little help:

tsx
import Image from "next/image";
import hero from "./hero.jpg";

<Image
src={hero}
alt="Team planning on a whiteboard"
priority
placeholder="blur"
sizes="(max-width: 768px) 100vw, 50vw"
/>;
  • priority on the largest image above the fold (usually your LCP element) so it loads first instead of lazily. Use it on one or two images per page, not all of them.
  • sizes tells the browser how wide the image will be displayed, so a phone downloads a phone-sized file. Without it, a responsive image may download far larger than needed.
  • Static imports (import hero from "./hero.jpg") give Next.js the width and height automatically, which prevents layout shift, and enable placeholder="blur".
  • Serve AVIF where browsers support it by adding images: { formats: ["image/avif", "image/webp"] } to next.config.ts. AVIF files are usually noticeably smaller than WebP.

Fonts

next/font downloads fonts at build time and serves them from your own domain, so there's no extra connection to a font host, and it adjusts fallback metrics so text doesn't jump when the font arrives:

tsx
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ["latin"], display: "swap" });

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" className={inter.className}>
<body>{children}</body>
</html>
);
}

Load only the subsets and weights you use; each extra weight is another file. A variable font covers every weight in one.

Third-party scripts

Analytics, chat widgets and tag managers are a common cause of poor INP. Load them with next/script and pick the latest strategy that still works:

tsx
import Script from "next/script";

<Script src="https://widget.example.com/chat.js" strategy="lazyOnload" />;
  • afterInteractive (the default) loads after the page becomes interactive. Right for analytics.
  • lazyOnload waits until the browser is idle. Right for chat bubbles and anything below the fold.
  • beforeInteractive blocks the page; reserve it for scripts that truly must run first, like a consent manager.

For Google Analytics, Tag Manager, Maps and YouTube embeds, @next/third-parties wraps them with sensible loading defaults.

Render static where you can, cache the rest

The fastest response is one that was built ahead of time.

  • Static by default. A page with no request-specific data (cookies, headers, search params) is prerendered at build time and served from the CDN.
  • Revalidate instead of going dynamic. For content that changes now and then, rebuild in the background on a timer:
ts
export const revalidate = 3600;

Or refresh on demand when content changes, by calling revalidatePath("/blog") or revalidateTag("posts") from a Server Action or a CMS webhook.

  • Prebuild dynamic routes with generateStaticParams, so /blog/[slug] pages exist before the first visitor asks for them.
  • Next.js 16 adds Cache Components. With cacheComponents enabled, a "use cache" directive caches a component or function's result, so a mostly static page can still stream in one personalised section.

Stream slow parts

If one part of a page waits on a slow API, don't make the whole page wait. Wrap it in Suspense, or add a loading.tsx next to the route, and Next.js sends the rest of the HTML immediately and streams that part in when it's ready:

tsx
import { Suspense } from "react";

export default function Page() {
return (
<>
<ProductDetails />
<Suspense fallback={<p>Loading reviews…</p>}>
<Reviews />
</Suspense>
</>
);
}

Visitors see content sooner, and crawlers still get the full page.

Measure, don't guess

  • PageSpeed Insights shows both a lab test and real-user Core Web Vitals from Chrome users, which is the data Google actually uses.
  • Lighthouse in Chrome DevTools is quick for checking a change locally; run it in an incognito window so extensions don't skew it.
  • useReportWebVitals from next/web-vitals reports LCP, INP and CLS from your real visitors to your own analytics. Vercel's Speed Insights does the same if you deploy there.
  • Search Console → Core Web Vitals groups slow URLs so you can fix the template, not page by page.

Checklist

SEO

  • metadataBase set to your production URL in the root layout
  • A title.template, and a unique title and description on every page
  • alternates.canonical on every indexable page
  • Shared Open Graph fields spread into each page's openGraph, not lost to the merge
  • robots.ts, with noindex (not disallow) for pages to keep out of results
  • Preview and staging deployments set to noindex
  • JSON-LD on articles and products, checked with the Rich Results Test
  • Important content rendered on the server, with one h1 per page

Sitemaps

  • sitemap.ts listing only canonical, indexable URLs that return 200
  • Absolute production URLs built from one constant, never localhost
  • lastModified from real content changes, never new Date()
  • Revalidated when content changes; split with generateSitemaps past 50,000 URLs
  • Referenced in robots.txt and submitted to Search Console and Bing

Link previews

  • An opengraph-image for the site, and generated ones for posts or products
  • 1200 × 630, a few hundred KB at most, on a public HTTPS URL
  • twitter.card set to summary_large_image
  • Tags confirmed with curl and the Facebook Sharing Debugger

Favicons

  • favicon.ico and icon.svg in the root of app/
  • apple-icon.png: 180 × 180, opaque, square corners
  • manifest.ts with 192, 512 and a maskable 512 icon
  • themeColor in viewport, and appleWebApp.title set

Performance

  • "use client" only on interactive leaves; heavy widgets loaded with dynamic
  • Bundle checked with @next/bundle-analyzer
  • priority on the LCP image, sizes on responsive images, AVIF enabled
  • Fonts through next/font, only the weights you use
  • Third-party scripts through next/script with lazyOnload where possible
  • Static or revalidated pages wherever the data allows; slow sections streamed with Suspense
  • Core Web Vitals checked in PageSpeed Insights and Search Console

Most of this never shows on the page itself. It shapes everything around it: the search result someone clicks, the card a friend sends them, the icon they tap the next day, and whether the page is already there when they arrive.