Sub topic 5
The meta description tag
This chapter assumes you know basic HTML structure (head and body), how URLs and query strings work, and what a search results page looks like. It covers what the meta description element is, how search engines use it, and the errors that cause it to be ignored or to fail. Writing technique and snippet generation get their own chapters, so this one stays on the tag itself.
What the tag is
The meta description is a <meta> element in the document <head>. Its name is description, and its content attribute holds a short summary of the page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Trail Running Shoes for Beginners | Example Store</title>
<meta name="description" content="Compare cushioned trail running shoes for first-time runners, with fit tips and a size guide.">
<link rel="canonical" href="https://www.example.com/shoes/trail-running">
</head>
<body>
<h1>Trail Running Shoes for Beginners</h1>
</body>
</html>The tag is a hint, not a command. Search engines read it during indexing and may show it as the text under your title in results. They are free to show something else.
What it does and does not do
The meta description has one job: it offers a candidate summary for the result snippet. Three consequences follow.
- It does not directly affect ranking. Google has said that it does not use the meta description as a ranking signal. A better description can still help indirectly, because a clearer snippet may earn more clicks from people who already see your result.
- It is not displayed on the page. Visitors never see it in the browser. Only crawlers, link-preview tools, and some social platforms read it.
- It is optional. A page without one is valid. The search engine builds a snippet from the page content instead.
Syntax rules
The element is small, but a few details matter.
- One tag per page. Put a single
<meta name="description">in the head. If a page has several, engines may pick one, combine them, or ignore them, and you cannot predict which. - It must be in the head. A meta element that ends up in the body is not treated as page metadata. This often happens when markup before it is broken, for example an unclosed tag or a
<div>injected into the head by a script on the server. - Escape special characters. The value sits inside a double-quoted attribute. A raw
"ends the attribute early and truncates the text. Use"or switch to typographic quotes. Escape&as&and<as<. - Use plain text. HTML tags inside the value are not rendered. They appear as literal characters or get stripped.
- Match the page language. Write the description in the language of the page, consistent with the
langattribute on<html>.
Here is a broken tag and its fix.
<!-- Broken: the inner quote ends the attribute, so the text is cut after "Our -->
<meta name="description" content="Our "best-fit" guide covers sizes 6 to 14.">
<!-- Fixed -->
<meta name="description" content="Our "best-fit" guide covers sizes 6 to 14.">Length and truncation
There is no official character limit in the HTML standard. Truncation happens at display time, and it depends on pixel width, not a fixed number of characters. A line of wide letters such as "W" and "M" fits fewer characters than a line of narrow ones such as "i" and "l".
Typical working ranges:
| Display | Approximate safe length |
|---|---|
| Desktop results | 150 to 160 characters |
| Mobile results | 110 to 120 characters |
| Hard upper bound for useful text | About 300 characters stored, much of it unseen |
These figures are rules of thumb. Engines change their layout without notice, so treat them as a planning range and check real results. A practical approach is to put the most important information in the first 110 characters. If the end is cut off with an ellipsis, little is lost.
Longer descriptions are not an error. The engine reads the whole value, but only part of it appears. Padding a description to reach a length target adds nothing.
How the engine decides to use it
A search engine does not always show your description. It picks a snippet per query, choosing among your meta description and passages from the page body. In general, it prefers your meta description when it describes the page accurately and fits what the searcher asked. It prefers body text when that text matches the query terms more closely.
This is why one page can show different snippets for different searches. For a search on a narrow phrase that appears only in a paragraph of your article, the engine may quote that paragraph. For a broad search, the meta description is more likely to appear.
Controlling the snippet
You have limited but real control through the robots meta tag, which can restrict how snippets appear.
<meta name="robots" content="nosnippet">
<meta name="robots" content="max-snippet:120">nosnippettells the engine to show no text snippet for the page. It also removes your meta description from results.max-snippet:Ncaps the snippet at N characters. Setting it lower than your description cuts that description short.
Use these on purpose. A nosnippet left in a shared template can strip descriptions from every page on a site.
If you want to keep a section of text out of snippets without hiding the whole snippet, Google supports the data-nosnippet attribute on span, div, and section elements.
Common problems
| Symptom | Likely cause | Fix |
|---|---|---|
| Result shows body text, not your description | Description does not match the query, or is generic | Make it specific to the page, and accept that the engine may still choose body text |
| Same description on many pages | Template default or a copied value | Generate a unique value per page, or omit it where you cannot write a good one |
| Description cut off mid-sentence in the markup | Unescaped double quote | Escape the quote, as shown above |
| Description missing from the crawled HTML | Tag injected by JavaScript that failed or ran late | Render the tag on the server, or confirm the rendered HTML contains it |
| No description shown at all | `nosnippet` in a robots meta tag or `X-Robots-Tag` header | Remove the directive |
| Stale text in results after an edit | Page not yet recrawled | Wait for a recrawl, or request indexing in the search console |
Duplicate descriptions deserve a note. They do not trigger a penalty, but they give the engine nothing page-specific to show, so it falls back to body text. For a large site, an empty description on low-value pages is better than one identical string repeated thousands of times.
Checking what the engine sees
Do not trust the source you wrote. Check what a crawler receives.
- View the raw response with
curland search for the tag. - Compare it to the rendered DOM in your browser's developer tools, in case scripts change it.
- Use the URL Inspection tool in Google Search Console to see the HTML Google rendered.
curl -s https://www.example.com/shoes/trail-running | grep -i 'name="description"'If the tag appears in the rendered DOM but not in the raw response, it depends on JavaScript. Engines can render JavaScript, but rendering is queued and can lag, so server-rendered tags are more reliable.
Summary of decision points
- Write one description per page, in plain text, in the head.
- Lead with the useful part, keep it near 150 characters, and expect mobile to show less.
- Leave it out rather than duplicating it across a site.
- Verify the tag in the raw HTML and the rendered result.
- Expect the engine to override it for some queries. That is normal behavior, not a bug.
Exercise
A product page shows this in its source: <meta name="description" content="The "Summit 2" pack holds 40 litres and weighs 900 g.">. In results, the snippet reads only The . What is wrong, and how do you fix it? Also name one reason the engine might later show body text instead of the fixed description.
Show answer
The unescaped double quotes around Summit 2 end the content attribute after "The ", so the stored value is truncated. Fix it by escaping the quotes as " (or using typographic quotes), giving content="The "Summit 2" pack holds 40 litres and weighs 900 g.". After the fix the engine may still show body text if the searcher's query matches a passage in the page more closely than it matches the description, because the snippet is chosen per query.
Exercise
A site template sets the same meta description on 5,000 category pages, and a recent release also added <meta name="robots" content="nosnippet"> to the shared head. Describe what searchers see and give the two changes you would make.
Show answer
Searchers see no text snippet on any of the pages, because nosnippet suppresses snippets entirely, including the meta description. Even without it, the identical description would give the engine nothing page-specific, so it would tend to use body text. Remove nosnippet from the shared template, and replace the duplicated description with a per-page value built from each category's own data, or omit the tag on pages where a unique description cannot be written.