Why Your Next.js App Doesn't Rank
The framework isn't why you're invisible. But there are about six ways a React app can quietly hide itself from search, and most teams ship at least two of them.
A framework doesn't earn rankings. No amount of correct configuration will make a thin page outrank a good one, and any post promising otherwise is selling something.
What a framework can do is stop you: quietly, in ways that don't show up in development and don't produce errors. That's the failure worth writing about, because it's fixable and it's common.
First: check what the crawler actually sees
Before anything else, establish the baseline. View source on a page that matters and look for your actual content in the HTML.
Not devtools: devtools shows the DOM after JavaScript has run. Use view-source,
or curl the URL, or the URL Inspection tool in Search Console. If your content
isn't there, nothing else in this post matters.
Google does execute JavaScript, so client-rendered content can get indexed. But it goes into a separate rendering queue, which can lag by days or longer, and anything that depends on a client-side fetch is at the mercy of that fetch succeeding in their environment. Other crawlers, including most of the ones that generate link previews and the ones feeding AI search, do far less, or none.
In the App Router the common cause is straightforward: a "use client"
directive too high in the tree, so the page that should have been server-rendered
now ships as a shell. The fix is to push the client boundary down to the
component that genuinely needs interactivity, and leave the content on the
server.
Metadata that's actually per-page
The most frequent real problem I see is every page sharing one title and description, because metadata was set once in the root layout and never overridden.
Every indexable route needs its own. In the App Router that's a metadata
export for static routes and generateMetadata for dynamic ones. Centralize the
construction so it's hard to forget:
export const metadata = buildMetadata({
title: "Building a Stripe Connect Marketplace: What It Takes",
description: "The Connect decisions that are hard to reverse.",
path: "/blog/building-a-stripe-connect-marketplace",
});
The piece most often missing from that builder is the canonical URL, and its
absence causes a specific, hard-to-diagnose problem. Without it you're likely
serving identical content at several addresses: with and without www, with
and without a trailing slash, with tracking parameters attached, and on your
*.vercel.app preview domain. Google picks one to index and it may not be the
one you want. Preview deployments in particular can end up in the index
competing with production.
Set the canonical explicitly on every page. Set metadataBase once so relative
paths resolve. And make sure preview environments send noindex: that's a
one-line environment check, and it prevents a genuinely annoying cleanup.
Sitemaps and robots rot
Both are trivially easy and both go stale the moment they're maintained by hand.
A hardcoded array of routes will be wrong within two months: someone adds a route and doesn't know the file exists. Generate what you can from the same source the app uses:
const posts = await getAllPosts();
return [
...STATIC_ROUTES.map((route) => ({ url: `${base}${route}` })),
...posts.map((p) => ({ url: `${base}/blog/${p.slug}`, lastModified: p.date })),
];
Static routes may still need a list, but anything derived from content should
derive itself. And lastModified should reflect real modification dates:
emitting today's date for every URL on every build tells crawlers nothing, and
they learn to ignore it.
Structured data, only where it pays
JSON-LD is worth adding where it maps to something Google actually renders
differently. In practice that's a short list: Article for posts,
BreadcrumbList for hierarchy, FAQPage for genuine question-and-answer
content, Product and Organization where they apply.
Two rules. Mark up what's visible on the page: describing content the user can't see is a manual-action risk, not a clever trick. And validate it, because a schema error means the whole block is silently ignored and you'd never know.
Everything else in the vocabulary is optional and mostly ignored. Adding forty types to a blog post doesn't help.
Core Web Vitals: one metric matters most
The vitals are a ranking factor, and a small one relative to content. Don't rebuild your app for a score. But LCP is worth attention because it correlates with something real: how long before the user sees the thing they came for.
The usual culprits, in order of how often I find them:
- Images without dimensions or optimization. Use
next/imagewith explicit sizing, setpriorityon the one above the fold, and nothing else. - Fonts loading late, causing a flash and a layout shift.
next/fontself-hosts and handles this; a raw@importfrom a font CDN does not. - Client components fetching content on mount. A skeleton is not an LCP. The crawler and the user both wait.
- A third-party script in the head. Analytics, chat widgets, tag managers.
Load them with
next/scriptand a non-blocking strategy.
Measure with real field data from Search Console rather than a lab score on your own machine. Lighthouse on a developer laptop over office wifi is not representative of a phone on mobile data, which is who you're actually serving.
Migrations lose rankings through redirects
If you're rebuilding an existing site, the most likely way to lose traffic isn't technical quality: it's URLs.
Export every indexed URL from Search Console before you start. Map each one to its new address. Implement permanent redirects for every single one, including the ugly legacy paths you'd rather forget. Then verify with a crawl after launch, because the ones you miss will be the ones with backlinks.
A 404 on a page that had authority throws away years of accumulated signal. The redirect map is the least interesting part of a migration and the part that determines whether traffic survives it.
The part no framework fixes
Everything above is hygiene. It stops you from being invisible. It doesn't make you rank.
Ranking comes from having pages that answer questions better than the pages currently answering them, and from other sites finding those pages worth linking to. If nothing on your site is the best available answer to anything, the technical setup is irrelevant: you've built a very fast, well-structured, correctly-canonicalized page that nobody has a reason to visit.
Get the hygiene right once. It's maybe two days of work and it stays right. Then spend your time on the part that's actually hard.