Sub topic 7
How search snippets are generated
This chapter assumes you know the HTML head and the meta description tag from earlier chapters. It also assumes you have seen a search results page. A snippet is the block of text shown under the title and URL of a result.
The snippet is chosen per query
The meta description is a candidate for the snippet. It is not a guarantee. Google builds the snippet when someone searches, and it can show different text for different queries on the same page.
Two sources compete:
- The meta description you wrote.
- Passages taken from the visible page content.
Google generally prefers whichever source describes the page better for that query. Say a page about trail running shoes has a generic description. A search for "trail shoe sizing" can then show the sizing paragraph from the body instead. Google has said publicly that it uses the meta description more often than not for some queries and falls back to page content when the description is missing, short, or a poor match.
What this means for your descriptions
Write one description per page that summarizes the page accurately. You cannot write a description for every query, so make sure the body content answers the questions people actually ask. Clear headings and self-contained paragraphs give the engine good passages to pull from.
Length is not fixed. Results are cut by pixel width, not by a character count. Around 120 to 160 characters often displays in full on desktop, and mobile can differ. Treat those numbers as a rough guide. Put the key information first, because anything at the end may be cut.
Controlling snippets
Robots directives let you limit what is shown. They restrict the snippet. They do not let you choose its text.
<meta name="robots" content="max-snippet:120">This asks search engines to show at most 120 characters of text. Other directives include nosnippet, which shows no text snippet at all. You can also mark part of a page with the data-nosnippet attribute on a span, div, or section element, to keep that text out of snippets.
<p>Public summary of the product.
<span data-nosnippet>Internal pricing note.</span></p>Use these carefully. nosnippet removes your description from results entirely, and that usually lowers click-through.
Common errors
| Symptom | Likely cause | Fix |
|---|---|---|
| Snippet ignores your description | It does not match the query, or it is generic | Write a specific summary and cover the topic in the body |
| Same snippet on many pages | Duplicate or template-wide descriptions | Generate unique descriptions per page |
| Snippet shows menu or cookie text | Page has little main content, or the layout hides it | Put real content high in the main element |
| Snippet is cut mid-sentence | Text is longer than the display width | Lead with the important point |
| No snippet at all | `nosnippet` or `max-snippet:0` is set | Remove or relax the directive |
Rewriting the description does not take effect instantly. The engine has to recrawl the page, and even then it may keep choosing page text.
Exercise
A page has a good meta description, but a search for a specific question shows a sentence from the body instead. Is this a bug, and what should you do?
Show answer
It is not a bug. The snippet is generated per query, and the engine picked a passage that matched the query better than the description. Keep the description as an accurate summary. Make sure the body answers common questions clearly. Do not try to force the description to appear for every query.