Sub topic 1
What the Title and Headings Do
The <title> element and the heading tags (<h1> to <h6>) are two of the main signals that tell search engines and readers what a page is about. This chapter explains the role of each, so the later chapters on keywords, title writing and heading structure have a base to build on.
Prerequisites
This chapter assumes you have the following:
- Basic HTML structure: you know what
<head>and<body>contain and can read common tags. - Familiarity with a search engine results page (SERP): you have seen the blue link, the URL and the description under it.
- A basic idea of what a keyword or search query is: the words a person types into a search box.
Two different jobs
The title and the headings look similar, but they sit in different places and serve different purposes.
| Feature | Where it lives | Who sees it first | Main job |
|---|---|---|---|
| `<title>` | Inside `<head>` | Searchers, as the clickable link in results, and in browser tabs | Label the whole page in a short line |
| `<h1>` | Inside `<body>` | Visitors, once they land on the page | State the page's main topic |
| `<h2>` to `<h6>` | Inside `<body>` | Visitors scanning the page, and assistive technology | Divide the page into nested sections |
The title is metadata. It is not displayed inside the page content. Browsers show it in the tab, bookmarks use it as the default name, and search engines usually use it as the headline of your result.
Headings are part of the visible content. They form an outline of the page, much like a table of contents.
What the title does
A title has two audiences at once.
- Search engines read it as a strong hint about the page's topic. A title that names the subject clearly helps a page be matched to relevant queries.
- Searchers read it in the results list and decide whether to click. A title that is clear and specific gets more clicks than a vague one.
Here is a title that serves both:
<head>
<title>How to Repot a Snake Plant: Step-by-Step Guide</title>
<meta name="description" content="Learn when and how to repot a snake plant, which pot and soil to use, and how to avoid root damage.">
</head>The phrase "repot a snake plant" appears near the start. The words "Step-by-Step Guide" tell the searcher what kind of page this is. The meta description is a separate element. It supplies the summary text that often appears under the title in results.
What headings do
Headings describe the structure of the content. Search engines use them to understand which parts of a page cover which subtopics. Readers use them to scan, because most people skim a page before deciding to read it.
- The
<h1>names the main topic of the page. <h2>headings name the major sections.<h3>headings name subsections inside an<h2>, and so on down to<h6>.
<body>
<h1>How to Repot a Snake Plant</h1>
<h2>When to repot</h2>
<h2>What you need</h2>
<h3>Choosing a pot</h3>
<h3>Choosing soil</h3>
<h2>Step-by-step repotting</h2>
<h2>Aftercare</h2>
</body>Read only the headings and you can already follow the page: when to repot, what to gather, how to do it, what to do afterwards. A good outline works on its own like that.
How they work together
The title and the <h1> should agree on the topic, but they do not have to be identical. The title is written for the results page, where space is limited and the page must compete with other results. The <h1> is written for someone who has already arrived, so it can be plainer.
For the snake plant page:
- Title: "How to Repot a Snake Plant: Step-by-Step Guide"
- h1: "How to Repot a Snake Plant"
Both point to the same subject, and the same key phrase appears in each. If they described different topics, the page would send mixed signals and the visitor might feel they landed on the wrong page.
What weak versions look like
The following example shows common mistakes. Later chapters rewrite it.
<!-- Weak: repeated keyword, skipped level, vague headings -->
<title>Snake plant | snake plant repotting | repot snake plant | best snake plant</title>
<h1>Snake Plant</h1>
<h4>Snake plant repotting tips snake plant</h4>
<h2>More</h2>Several things are wrong:
- The title repeats the same phrase four times. It reads like a list of keywords, not a description.
- The
<h1>is too broad. "Snake Plant" does not say what the page offers. - The
<h4>appears before any<h2>or<h3>, so a level is skipped. - "More" says nothing about what the section contains.
Exercise
A page has the title "Snake plant | snake plant | snake plant care" and an h1 of "Welcome". Name two jobs the title and h1 should be doing that these are not.
Show answer
The title should label the page clearly and specifically for searchers, so they can tell what it offers and decide to click. The h1 should state the main topic for visitors who have arrived, and "Welcome" does not name any topic. Also, the title and h1 should agree on the subject, and here they do not.
Exercise
Where does each live in the HTML document, and which one is visible inside the page content: the title or the h1?
Show answer
The title lives inside the head, and the h1 lives inside the body. The h1 is visible in the page content. The title appears in the browser tab and in search results, not within the page itself.