How to fix search results indexable on Headless / Custom (I build in code)
Add a noindex robots meta tag to all internal search result pages and block the search URL path in robots.txt to prevent Google from crawling and indexing thin, duplicate search results.
Steps for Headless / Custom (I build in code)
- In your search results page component or route handler, conditionally render <meta name="robots" content="noindex,follow"> in the document <head> whenever the current route matches your search path.
- In Next.js (App Router): in your app/search/page.tsx, export a generateMetadata function returning { robots: { index: false, follow: true } }.
- In Next.js (Pages Router): use next/head to inject <meta name="robots" content="noindex,follow"> inside your search page component.
- In Nuxt.js: use useHead({ meta: [{ name: 'robots', content: 'noindex,follow' }] }) inside your search page's setup() or definePageMeta.
- For robots.txt: add Disallow: /search (or your search path) to your static public/robots.txt file, or generate it dynamically from your server.
- Deploy and verify with Google Search Console URL Inspection.
What is search results indexable?
When a visitor searches your store, the results appear on a dynamically generated URL — for example, `/search?q=red+shoes` or `/search-jobs?category=sales&location=texas`. These URLs are "internal search result pages." Unlike your product or category pages, search result pages contain no unique content of their own — they just reflect whatever a user happened to type. Because the query string can be almost anything, your site can generate millions of slightly different URLs, each showing slightly different (or empty) results. Right now, Google can find and index those URLs, meaning they appear — or could appear — in search engine results.
Indexable internal search pages damage your SEO in three concrete ways. First, they dilute your crawl budget: Googlebot wastes time fetching thousands of low-value search URLs instead of your actual product and category pages — pages that actually drive revenue. Second, search result pages are "thin content" in Google's eyes (little original text, no unique value), which can drag down your site's overall quality signal and reduce rankings for your real pages. Third, an unbounded query-string space creates a theoretically infinite number of URLs, which can cause Google to deprioritize your entire domain as a crawl and index target. Blocking these pages costs you nothing in organic traffic (nobody reaches your site by Googling your own search results) and frees up crawl budget and authority for the pages that actually sell.
See the complete Search results indexable guide for every platform and the full background.
Not sure if your Headless / Custom (I build in code) store has this?
Run a free SEOLZ scan — we’ll find search results indexable and every other issue across your whole site.
Scan my site free