Question

Internal Search Optimization: Site Search SEO

4 min read

Short answer

Site search does two things for SEO. Its result pages are a crawling problem to contain: every query can create a URL, so those pages should be kept out of crawling or out of the index. And its query log is a research asset: the words visitors type show what they want, what they can't find, and what your navigation calls things they call something else. Manage the first with one clear technical choice, and use the second to improve products, pages and labels.

Sources

  1. 1developers.google.com
  2. 2support.google.com

Ask next

Keeping Search Result Pages Out of Google

Choose one method per URL pattern:

Method What it does When to use it
robots.txt disallow Stops crawling of search URLs The default choice; saves crawling
<!–INLINECODE0–> on result pages Lets Google crawl but keeps pages out of the index When result pages are already indexed and need removing

Don’t combine them on the same URLs. Google’s documentation on noindex says that for the rule to work, the page “must not be blocked by a robots.txt file”; if it is, “the crawler will never see the noindex rule, and the page can still appear in search results, for example if other pages link to it.” To remove indexed result pages, allow crawling with noindex until they drop out, then add the robots.txt rule.

A robots.txt example. Disallow rules belong to a user-agent group, and paths match as prefixes, so write them narrowly:

User-agent: *
Disallow: /search/
Disallow: /search?
Disallow: /*?s=
Disallow: /*&s=

Disallow: /search alone would also block any path starting with those letters, such as /searchlight-lamp. Adjust the parameter names to your platform and test before release; see robots.txt.

What doesn’t work. Search Console’s URL Parameters tool was retired in 2022, so parameters are managed on the site. A canonical from search result pages to the home page isn’t a reliable way to keep them out: canonical is a hint about duplicates, and a result page isn’t a duplicate of the home page.

Pages to Build Instead

When the log shows a broad query used again and again (“waterproof jackets”, a brand name), a curated category or landing page can serve that query better than a raw result page, for site visitors and for search. Build it as a real page with its own content and links; see category page optimization.

Measuring Site Search in GA4

GA4’s enhanced measurement records a view_search_results event “each time a user is presented with a search results page, as indicated by the presence of a URL query parameter”. By default it looks for the parameters q, s, search, query and keyword, and you can add others; the query fills the Search term dimension. If your search uses a different parameter or no URL change, configure it or send the event yourself.

What to look at What it tells you
Top search terms What visitors look for, in their words
Searches with no results Products or content you don't have, or synonyms you don't match
Searches followed by exits Results that didn't help
Searches followed by key events Queries that lead to sales or leads
Search use by landing page Pages where visitors couldn't find what they expected

GA4 setup is covered in GA4 for SEO.

Using the Query Log

  • Rename navigation where visitors’ words differ from your labels.
  • Add synonyms and spelling tolerance to the search tool for terms that return nothing (“couch” for “sofa”).
  • Fill gaps: a repeated query with no results is a product, content or page idea, to check against external keyword data before acting; see keyword research methodology.
  • Answer questions that visitors type into search, on the pages they were looking at.

The Search Experience

  • Show the query and the number of results, with a way to refine.
  • Sort by relevance by default, with filters for large result sets.
  • Never leave a dead end: with no results, show suggestions, popular categories and a way to contact you.
  • Make it work on mobile: an easy-to-reach search field and readable results.

Mistakes

Mistake Fix
Search result pages crawlable and indexed robots.txt disallow, or <!–INLINECODE10–> while removing them
robots.txt and <!–INLINECODE11–> on the same URLs Choose one
Over-broad robots.txt rule Write the pattern narrowly and test it
Search terms not tracked Configure GA4 site search
Zero-result queries ignored Review them on a schedule

Before building a page for a repeated zero-result query, check the term in external keyword data; a gap only your own visitors search for may need a synonym or a renamed label rather than a new page.

Link profile