Sub topic 5
The meta description tag
This chapter assumes you know the basic structure of an HTML page (head and body) and have seen a search results page. It covers what the meta description tag is, how to write it in HTML, and the errors that break it.
What the tag does
The meta description is a <meta> element in the page's <head>. It gives a short summary of the page. Search engines may use that summary as the snippet, the grey text shown under the title in results.
Two points matter for how you treat it:
- It is a hint, not a command. The search engine can show your text or choose different text from the page.
- It is not a ranking signal. Google has said it does not use the description to rank pages. It affects how your result looks, and so whether people click.
Syntax
The tag uses two attributes. name="description" identifies the tag. content holds the summary text.
<!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 description matches the title and the <h1>. All three describe the same page, and the description adds detail the title has no room for.
Quotes and special characters
The value sits inside double quotes. A literal double quote inside the text ends the attribute early and cuts your description short. Use " or rephrase. Write & for an ampersand if you want valid HTML.
<meta name="description" content="Our "no-slip" soles grip wet rock & mud.">Length
There is no fixed character limit. Search engines truncate by pixel width, and the width depends on the device and the letters used. A practical range is about 120 to 160 characters. Put the most important information first, because anything cut off is lost.
Common errors
| Error | What happens | Fix |
|---|---|---|
| No description tag | The engine builds a snippet from page text. The result may be fine or poor. | Add a tag to pages that matter. |
| Same text on many pages | Pages look alike in results, and the snippet fits few of them. | Write one per page, or omit it. |
| Two description tags | The engine picks one, and you cannot control which. | Keep exactly one per page. |
| Tag placed in `<body>` | It may be ignored. | Keep it inside `<head>`. |
| Wrong attribute, such as `name="descripton"` | The tag is ignored without any error. | Check the spelling. |
| Unescaped double quote | The text is cut at the quote. | Escape it. |
> Note: a description that is missing is often better than one copied across hundreds of pages. A duplicate tells the engine nothing about the individual page.
Checking your work
View the page source (not just the rendered page) and search for name="description". If you generate pages from templates, check the output HTML, because a template variable that is empty produces content="". An empty value is treated like a missing tag.
The next chapter covers how to write descriptions that earn clicks, and a later chapter explains how snippets are chosen.
Exercise
A product page has <meta name="description" content="Handmade "waterproof" boots.">. The snippet in search results appears as "Handmade ". What went wrong, and how do you fix it?
Show answer
The unescaped double quotes around waterproof end the content attribute early, so the value is only "Handmade ". Escape them with " (content="Handmade "waterproof" boots.") or remove the quotes.
Exercise
Your site has 500 product pages that all use the description "Shop the best products at Example Store." Name two problems and one better option.
Show answer
The pages look identical in results, and the text says nothing about each product, so the engine may ignore it and build its own snippet. A better option is to write a unique description per page, generated from product details such as name, key feature, and category. If that is not possible, omit the tag and let the engine pick text from the page.