---
title: "useSearchParams Suspense SEO: Next.js Pages Shipping Empty HTML"
description: "A null Suspense fallback around useSearchParams ships empty HTML on static Next.js routes. How to spot it with curl and the build output, and three fixes."
canonical: "https://www.razi.pro/blog/usesearchparams-suspense-empty-html-seo"
date: "2026-12-03"
tags: ["Next.js", "SEO", "React Suspense", "useSearchParams", "Web Development"]
source: "razi.pro"
---

# useSearchParams Suspense SEO: Next.js Pages Shipping Empty HTML

Before you read on: what would make a blog post with 2,000 words in it reach Google as roughly 40 words and no ``?

On razi.pro the answer was one line, ``, sitting around a component that called `useSearchParams()`. The page looked perfect in the browser. `next build` passed. Every blog post, the tools index and several tool pages were still sending crawlers an empty shell, until the fix on 10 September 2026.

This post is about that one problem: what the Suspense fallback has to do with SEO, how to check whether you have it, and three ways to fix it.

## The symptom

You only see it in the raw HTML. Open the page normally and everything is there, because JavaScript fills it in a moment later. Open **view-source** instead, or fetch the page with `curl`, and the main content is missing. The header and footer from your layout may be present. The part inside the Suspense boundary is not.

On razi.pro the blog post page looked like this:

```tsx
// app/blog/[slug]/page.tsx (before)
{/* BlogPostClient reads useSearchParams; without this boundary the whole
    post falls back to client-side rendering and cannot be prerendered. */}
<Suspense fallback={null}>
  <BlogPostClient
    post={post}
    allPosts={publishedPostSummaries()}
    series={getSeriesForPost(post)}
  />
</Suspense>
```

Look at the comment. It is correct, and it is the reason the bug survived. Without the boundary the build fails. With the boundary the build passes, so it feels fixed. But `BlogPostClient` was the entire post: title, body, author box. With a `null` fallback, the prerendered HTML held nothing in its place.

And why did `BlogPostClient` call `useSearchParams()` at all? To read two flags, `?favoriteRedirect=1` and `?autoFavorite=1`, that resume a "favourite this post" action after sign-in. A feature most visitors never trigger was blanking the page for every crawler.

## Why the CSR bailout empties everything up to the nearest Suspense

A statically rendered (prerendered) route is built once, at build time. There is no request at build time, so there is no query string. Next.js cannot know what `useSearchParams()` will return.

The [useSearchParams docs](https://nextjs.org/docs/app/api-reference/functions/use-search-params) describe what happens next:

> If a route is prerendered, calling `useSearchParams` will cause the Client Component tree up to the closest `Suspense` boundary to be client-side rendered.

Read the last part twice: *up to the closest Suspense boundary*. Next.js does not skip just the component that reads the params. It skips everything between that component and the nearest boundary above it, and writes the boundary's **fallback** into the HTML instead.

If there is no boundary at all, the bailout reaches the top of the page. That is the case the build refuses, with the [Missing Suspense boundary with useSearchParams](https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout) error (`missing-suspense-with-csr-bailout`). Its explanation:

> Reading search parameters through `useSearchParams()` without a Suspense boundary will opt the entire page into client-side rendering. This could cause your page to be blank until the client-side JavaScript has loaded.

So the build protects you from a blank *page*. It does not protect you from a blank *boundary*. If your boundary wraps the whole page component and its fallback is `null`, you get the same blank result, and the build is happy.

Google does render JavaScript, so the content may get indexed in the end. But you have made indexing depend on a second rendering pass, and many other crawlers, including AI crawlers that fetch the raw HTML, never run your JavaScript at all. For them the page is empty.

> **A warning worth the detour.**
> In development none of this shows up. The docs say it plainly: "In development, routes are rendered on-demand, so `useSearchParams` doesn't suspend and things may appear to work without `Suspense`." You can test the page locally all day and see the content. Only a production build (and the HTML it writes) shows the empty shell. It cost me every blog post's raw HTML for an unknown stretch of time; checking with `curl` costs you ten seconds.

## How to check

### 1. Is the route static? Read the build output

The bug only exists on prerendered routes, so start there. [`next build`](https://nextjs.org/docs/app/api-reference/cli/next) prints a route table with a symbol in front of each route:

```text
Route (app)
┌ ○ /_not-found
└ ƒ /products/[id]

○  (Static)   prerendered as static content
ƒ  (Dynamic)  server-rendered on demand
```

A `○` route is built once, without a request, and a Suspense fallback is what ends up in its HTML. A `ƒ` route is rendered per request, and the docs say `useSearchParams` "will be available on the server during the initial server render" there. Write down which of your routes are `○` and also call `useSearchParams()`. Those are the suspects.

### 2. Look at the HTML a crawler gets

Fetch the page without a browser and count headings:

```bash
curl -s https://your-site.example/blog/some-post | grep -o '<h1' | wc -l
```

You want exactly `1`. A `0` on a page that clearly shows a heading in the browser means the heading is rendered by JavaScript, not delivered in the HTML. Then check a sentence you know is in the body:

```bash
curl -s https://your-site.example/blog/some-post | grep -c "a sentence from the second paragraph"
```

If it returns `0`, crawlers that do not run JavaScript see none of your content.

Two things can confuse this check. First, `grep -c` counts *lines*, and minified HTML is often one long line, so use `grep -o ... | wc -l` to count matches. Second, if your host has bot protection on, `curl` may get a challenge page instead of your HTML. When I ran these commands against razi.pro on 3 December 2026, Vercel answered with `429` and `X-Vercel-Mitigated: challenge`, so I checked the status code first: `curl -s -o /dev/null -w '%{http_code}' URL`. A 429 tells you nothing about your Suspense boundaries.

### 3. Ask Google

In Search Console, the [URL Inspection tool](https://support.google.com/webmasters/answer/9012289) shows the HTML Google fetched and rendered for a URL. Use it to confirm a fix for Google specifically. It cannot tell you what the crawlers that skip JavaScript see; the `curl` check does that.

## Three fixes

All three keep the build passing. Pick based on what the search params actually do on the page.

### Fix 1: make the fallback the page itself

If a component needs the params to *adjust* a view that otherwise renders fine without them, render that same view with empty params as the fallback. The prerendered HTML then holds the full default view, and the real params apply after hydration.

This is what razi.pro does on the tools index, which reads a `?for=` profession filter:

```tsx
// app/tools/ToolsIndexClient.tsx (after)
// useSearchParams needs a Suspense boundary. Rendering the view with empty
// params as the fallback keeps the full catalogue in the prerendered HTML
// (a null fallback shipped crawlers an empty shell), then the real ?for=
// filter is applied on the client.
const NO_PARAMS = new URLSearchParams();

export default function ToolsPage() {
  return (
    <Suspense fallback={<ToolsView searchParams={NO_PARAMS} />}>
      <ToolsWithParams />
    </Suspense>
  );
}

function ToolsWithParams() {
  return <ToolsView searchParams={useSearchParams()} />;
}

function ToolsView({ searchParams }: { searchParams: URLSearchParams }) {
  // ...the whole page, reading searchParams.get("for")
}
```

Before, `app/tools/page.tsx` wrapped the component in a bare ``, which has no fallback at all. The same pattern now sits in `UrlShortenerPage` (`?tab=` and `?view=`), `FileShareTool` and `YouTubeStudioPage`.

The trick is that the view takes the params as a prop instead of calling the hook itself, so the same component can render with real or empty params.

### Fix 2: push the boundary down, or drop the hook

The Next.js error page's first suggestion is to "wrap the smallest subtree that calls `useSearchParams()` in `Suspense`". The smaller the subtree, the less the fallback replaces. A search box in the header can bail out on its own while the article below it stays in the HTML.

Sometimes the smallest subtree is nothing. On the blog post the params were never *rendered*; they only triggered an effect. So the hook went away entirely:

```tsx
// components/blog/BlogPostClient.tsx (after)
// Read from window.location rather than useSearchParams: the hook needs a
// Suspense boundary, and wrapping this component in one shipped every post to
// crawlers as an empty shell. The flag is never rendered, only acted on in the
// effect below, so the server (false) and client values cannot mismatch.
const [autoFavoriteRequested] = useState(() => {
  if (typeof window === "undefined") return false;
  const params = new URLSearchParams(window.location.search);
  return params.get("favoriteRedirect") === "1" || params.get("autoFavorite") === "1";
});
```

With no `useSearchParams()` left, the page no longer needs a Suspense boundary, and `app/blog/[slug]/page.tsx` renders `BlogPostClient` directly. The commit message records the result: posts went from about 40 words to about 2,000 in the HTML, with one ``.

Only do this when the value never affects what is rendered. If it does, the server HTML and the first client render will disagree and React will report a hydration mismatch.

### Fix 3: read searchParams on the server page

If the params decide the content, let the server read them. Pages receive a `searchParams` prop, and the docs suggest it: "If you're already in a Server Component Page, consider using the `searchParams` prop and passing the values to Client Components."

Know what this costs. Reading `searchParams` needs a request, so the route stops being `○` and becomes `ƒ`, rendered on demand. That is the right trade when the content really depends on the query string. On razi.pro, `/games/cv-roaster` and `/games/regex-golf` read `?r=` in `generateMetadata` so that a shared score gets its own title and preview, which makes them dynamic routes.

The error page also shows a variant: pass the `searchParams` promise to a Client Component and unwrap it with React's `use()`. That suspends too, so it still needs a Suspense boundary, and the fallback rules above still apply. I have **not tried** that variant on razi.pro.

## Trade-offs

**A real fallback on a dynamic route doubles the page.** This is the one place where `fallback={null}` is correct. On a `ƒ` route the server already renders the real view with the real params and streams it in. A full-view fallback there would put the page in the HTML twice, `` included. So the CV Roaster keeps its null fallback, with a comment saying why:

```tsx
// app/games/cv-roaster/CVRoasterGame.tsx
// The route is dynamic (generateMetadata reads `?r=`), so the server renders
// the real view and streams it into this boundary. The fallback must stay
// null: a pre-rendered view here would put the game in the HTML twice.
```

The same `null` is a bug on a `○` route and correct on a `ƒ` route. That is why the first check is the route symbol.

**Fix 1 can flash.** A visitor who arrives with `?for=developers` first sees the unfiltered catalogue, then the filtered one. For a filter that is fine. For something like a share result that changes the whole page, Fix 3 is better.

**Fix 2 with `window.location` is not reactive.** The `useState` initializer reads the URL once. If the query string changes during client-side navigation, the value does not update. On the blog post that was acceptable because the flag is a one-shot action.

**Fix 3 costs a static page.** A `ƒ` route renders on every request instead of being served from the build. On a hosting plan with a compute quota, that is a real cost, so keep the dynamic routes to the ones that need the query string.

The rule I now follow before touching any Suspense and `useSearchParams` code: check the route's `○` or `ƒ` in the build output, then `curl` the page and count the `` tags. One is the right answer.
