Skip to content
Tutorials Center
My learning

Topics

Lesson 51 of 122 ยท The Head, Metadata and SEO

Page Titles and Descriptions

Write page titles and meta descriptions that work for people and search results. Learn about length, uniqueness, branding and how search engines use them.

Two short pieces of text do a lot of work for every page you publish: the <title> element and the meta description. Together they are often the first thing a person sees of your page, long before they visit it: in a search result, a browser tab, a bookmark list or a shared link.

This lesson is about writing them well. You will learn what each one is used for, how long they should be, why every page needs its own, and what search engines actually do with them (which is less than some myths suggest, and more than nothing).

Where the title shows up

The text in <title> is reused in many places:

  • Browser tabs and windows. With twenty tabs open, only the first few words are visible.
  • Bookmarks and history. The title becomes the bookmark's default name.
  • Screen readers. The title is announced when a page loads, so it tells blind users where they have landed.
  • Search results. Search engines usually show the title as the clickable headline of a result.
  • Shared links. Chat apps and social networks fall back to the title when a page has no social sharing tags.
HTML
<head>
  <meta charset="utf-8">
  <title>Sourdough Starter: A 7-Day Guide โ€“ Crumb & Crust</title>
</head>

Because the title is read in so many contexts, it has to make sense on its own, without the rest of the page around it.

Writing a good title

A good title answers one question: what is this page? A few habits help:

  • Be specific. "Products" could be any shop. "Waterproof Hiking Boots for Women" is one page.
  • Put the important words first. Tabs and search results cut titles off at the end, so start with what makes the page unique.
  • Add your brand at the end, after a separator such as an en dash (โ€“), a pipe (|) or a colon. Your home page is the exception: there, the brand can lead.
  • Match the content. If the page is about repotting cacti, say so. A misleading title wins a click and loses the visitor.
  • Write for humans. Repeating keywords ("Cheap Boots, Boots Sale, Best Boots") looks like spam to people and to search engines.

Compare a few pairs:

Weak Better
Home Crumb & Crust โ€“ Sourdough Recipes and Baking Classes
Blog post Why Your Sourdough Is Dense (and 5 Ways to Fix It) โ€“ Crumb & Crust
Untitled Document Order Confirmation #48213 โ€“ Crumb & Crust
BOOTS BOOTS BEST BOOTS Waterproof Hiking Boots for Women โ€“ Trailhead Outfitters

The title and the <h1> can differ. The <h1> is read on the page, where the site's logo and navigation give context. The title travels alone, so it usually needs the brand and sometimes a little more detail. They should still describe the same topic.

How long should a title be?

There is no length limit in HTML, but displays are limited. Search engines truncate titles by pixel width, not character count, so "WWW" uses more room than "iii". On a typical desktop result, around 50โ€“60 characters usually fit before an ellipsis appears; on phones the line wraps differently.

Treat that as a guideline, not a rule. A title that runs a little long is fine if the important part comes first. Try it out:

Title length checker

The preview cuts the title off at about 560 pixels, roughly what a search result has room for. Shorten the title until the brand fits, then try a title in capital letters and watch how quickly it runs out of space.

One title per page, and make it unique

Every page on your site should have its own title. When fifty pages share "Products โ€“ Trailhead Outfitters", visitors cannot tell the tabs apart, and search engines cannot tell which page answers which question.

Templates are the usual cause. If your pages are generated, build the title from the page's own data:

HTML
<title>{product name} โ€“ {category} โ€“ Trailhead Outfitters</title>

The same goes for pages that change state. A web app can update the title with JavaScript whenever the view changes:

HTML
<script>
  document.title = '(3) Inbox โ€“ Mailroom';
</script>

Keep these updates meaningful: a count of unread messages or the step of a checkout is useful; a title that flashes to grab attention is not. When a form has errors, putting "Error:" at the start of the title is a helpful accessibility pattern, because screen reader users hear it right away.

The meta description

The meta description is a one- or two-sentence summary of the page. It lives in the head and is never shown on the page itself:

HTML
<meta name="description" content="Dense, gummy sourdough usually comes down to a weak starter or short proof. Here's how to spot the cause and fix it in your next bake.">

Search engines may show it as the snippet under the title in results. Notice the word may. Search engines often write their own snippet from text on the page when it matches the search better, so the same page can show different snippets for different searches.

Here is what the description does and does not do:

  • It is not a ranking factor in Google's search. A better description does not move your page up.
  • It can earn clicks. A clear, accurate summary helps people decide that your page is the one they want.
  • It is reused. Social networks and chat apps may show it when there are no Open Graph tags.

Forget <meta name="keywords">. Major search engines have ignored it for many years. It adds bytes, tells competitors what you are targeting, and does nothing else.

Writing a good description

  • Summarize the page honestly in plain sentences. Say what the reader will get.
  • Keep it reasonably short. Snippets are truncated by width too; around 120โ€“160 characters usually displays in full. Longer is allowed, but the end may be cut.
  • Make every description unique. Duplicate descriptions across many pages are less helpful than none, because search engines will then usually generate their own.
  • Include specific facts where they matter: a price, a date, an author, a reading time.
  • Avoid keyword stuffing. A long list of keywords reads badly and is likely to be replaced.

The example below builds a mock search result from the page's own head. Edit the title or the description and see how the result changes.

Search result preview

The character cut-offs in this demo are simplified; real search results measure pixel widths and change their layout often. Use previews like this to catch titles and descriptions that are clearly too long or too vague, not to chase an exact number.

What search engines may change

Search engines treat your title and description as strong suggestions. They may rewrite a title when it is missing, empty, stuffed with keywords, identical across many pages, or does not match the content. In that case they may build a headline from your <h1>, other headings or links pointing to the page.

You cannot force a particular result, but you can make rewriting unnecessary: give each page a unique, accurate, descriptive title and description, and make sure the visible headings tell the same story. To understand the other tags search engines read, continue with Meta Tags, and for richer search results see Structured Data.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why should the most important words come first in a title?

    Tabs show only a few words and search results cut titles off by width, so whatever comes first is what people are most likely to see.
  2. 2. Which statement about the meta description is true?

    The description is not a ranking factor, and search engines may replace it with text from the page. When it is shown, a clear summary helps people choose your result.
  3. 3. Fifty product pages all use <title>Products โ€“ Trailhead</title>. What is the main problem?

    Every page should have a unique title built from its own content, such as the product name, so tabs, bookmarks and results are distinguishable.
  4. 4. What should you do with <meta name="keywords">?

    Major search engines have ignored the keywords meta tag for many years, so it has no benefit.

Summary

  • The <title> names the page in tabs, bookmarks, screen readers, search results and shared links, so it must make sense on its own.
  • Be specific, put the unique words first and the brand last, and give every page its own title.
  • Search results truncate titles and descriptions by pixel width; roughly 50โ€“60 and 120โ€“160 characters are useful guides, not rules.
  • The meta description is not a ranking factor, but a clear, unique summary can earn clicks when it is shown.
  • Search engines may rewrite titles and snippets that are missing, duplicated, stuffed or inaccurate.
  • <meta name="keywords"> is ignored; leave it out.

Next lesson: Meta Tags.