Sub topic 13
Write the title tag and meta description
This chapter assumes you already have a title and a subtitle for your course page, and that you can read simple HTML tags. You will turn that page copy into the metadata that search engines and social platforms show before anyone visits your page.
What metadata does
Metadata is information about a page that sits in the page's <head> section. Visitors do not see it on the page itself. They see it in three places:
- The browser tab, which shows the title tag.
- Search results, which show the title tag and often the meta description.
- Shared links on social platforms and chat apps, which show the Open Graph tags.
Each place is a first impression. A searcher choosing between ten results reads your title tag and meta description and decides in a second or two whether to click. If those two lines say something different from what the page says, the visitor feels misled and leaves.
The rule for this chapter: reuse the wording of your page copy. You already did the hard work of finding the learner, the outcome, and plain words. Metadata should repeat that work in a shorter form.
The four tags
| Tag | Where it appears | What it should contain |
|---|---|---|
| `<title>` | Browser tab, search result headline | Course title, plus a short site or brand label |
| `<meta name="description">` | Search result snippet | Subtitle wording: audience, method, outcome |
| `og:title` | Link previews when shared | Course title, no brand label needed |
| `og:description` | Link previews when shared | A shorter version of the description |
"Open Graph" is a set of tags that Facebook introduced and that most social and chat platforms now read. The names begin with og:.
Write the title tag
The title tag is the clickable headline in search results. Build it from your page title.
Start with your H1:
Write Portfolio Case Studies That Win ClientsAdd a short label, separated by a pipe or a dash:
Write Portfolio Case Studies That Win Clients | CourseFollow these rules:
- Put the outcome first. Search engines cut off titles that are too long, and the cut happens at the end. The most important words go at the start.
- Keep it near 50 to 60 characters. Search engines truncate by pixel width, not character count, so this is a guide. Wide letters such as "W" and "M" use more space than "i" and "l".
- Make it match the H1. It does not have to be identical, but a visitor who clicks should recognize the page.
- Write it for people. Do not stack keywords such as "Portfolio Course | Case Study Class | Design Training". It reads as spam and does not help you rank.
- Make each page's title unique. If you sell several courses, each one needs its own title tag. Duplicates make results hard to tell apart.
If your H1 is already long, you can drop the brand label. If it is too long even then, shorten it by cutting the least useful words, not the outcome.
Write the meta description
The meta description is a summary of one or two sentences. Search engines often show it under the title, but they may choose a different excerpt from your page if they think it fits the search better. Treat it as a strong suggestion, not a guarantee.
Aim for about 120 to 155 characters. Longer descriptions are usually cut off.
Build it from your subtitle. The subtitle already names the audience and the method:
A step-by-step course for freelance designers: structure, write, and publish three case studies.A meta description does two jobs that the subtitle does not need to do. It should confirm the visitor is in the right place, and it should give a reason to click. You can add a small call to action or the outcome:
A step-by-step course for freelance designers. Structure, write, and publish three portfolio case studies.That version is 106 characters. It names the audience, the method, and the deliverable. You could add a short invitation such as "Start with the free first lesson" if that is true.
Rules for the description:
- Say what the visitor gets, not what the page "is about".
- Use the same terms as the page. If the page says "case studies", do not write "project write-ups".
- Do not promise anything the page does not deliver.
- Write a different description for each page.
- Avoid quotation marks inside the content value, because a straight double quote ends the attribute early. Use single quotes or rewrite the sentence.
Write the Open Graph tags
When someone pastes your link into a chat or a social post, the platform fetches your page and reads the og: tags to build a preview card.
At minimum, set og:title and og:description. Many platforms also use og:image and og:url, which this chapter does not cover in depth.
og:titlecan be the plain course title, since the preview card often shows the site name separately.og:descriptioncan be shorter than the meta description, because cards have less room.
If you leave the Open Graph tags out, many platforms fall back to the title tag and meta description. Setting them explicitly gives you control over the preview.
Put it together
This <head> block uses the course from the earlier chapters. Every string comes from the page copy.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Write Portfolio Case Studies That Win Clients | Course</title>
<meta name="description" content="A step-by-step course for freelance designers. Structure, write, and publish three portfolio case studies.">
<meta property="og:title" content="Write Portfolio Case Studies That Win Clients">
<meta property="og:description" content="A step-by-step course for freelance designers.">
<meta property="og:type" content="website">
</head>
<body>
<section class="hero">
<h1>Write Portfolio Case Studies That Win Clients</h1>
<p class="subtitle">A step-by-step course for freelance designers: structure, write, and publish three case studies.</p>
</section>
</body>
</html>Notice that the title, subtitle, and metadata all use the same key words: "portfolio case studies", "freelance designers", "step-by-step". A visitor moving from search result to page sees one consistent message.
Check your work with a script
You can check lengths and mismatches automatically. This Python script reads an HTML file and reports the length of the title tag and meta description, and whether the H1 text appears in the title tag. It uses only the standard library.
import sys
from html.parser import HTMLParser
class HeadReader(HTMLParser):
def __init__(self):
super().__init__()
self.title = ""
self.description = ""
self.h1 = ""
self._current = None
def handle_starttag(self, tag, attrs):
attrs = dict(attrs)
if tag == "title":
self._current = "title"
elif tag == "h1":
self._current = "h1"
elif tag == "meta" and attrs.get("name") == "description":
self.description = attrs.get("content", "")
def handle_endtag(self, tag):
if tag in ("title", "h1"):
self._current = None
def handle_data(self, data):
if self._current == "title":
self.title += data
elif self._current == "h1":
self.h1 += data
def check(path):
with open(path, encoding="utf-8") as f:
reader = HeadReader()
reader.feed(f.read())
title = reader.title.strip()
description = reader.description.strip()
h1 = reader.h1.strip()
print(f"Title tag: {len(title)} characters")
if not 1 <= len(title) <= 60:
print(" Warning: aim for 60 characters or fewer.")
print(f"Meta description: {len(description)} characters")
if not description:
print(" Warning: no meta description found.")
elif len(description) > 155:
print(" Warning: may be cut off in search results.")
if h1 and h1.lower() not in title.lower():
print(" Warning: the H1 text does not appear in the title tag.")
else:
print("H1 and title tag match.")
if __name__ == "__main__":
check(sys.argv[1])Save it as check_meta.py and run python check_meta.py index.html. For the example above it reports a title tag of 54 characters, a description of 106 characters, and a match between the H1 and the title tag.
Common errors
- Missing tags. A page with no meta description gets whatever excerpt the search engine picks, which is often a menu or cookie notice.
- The same metadata on every page. Templates often copy one title and description across a whole site. Check each course page.
- Keyword stuffing. Repeating terms does not help and makes the result less clickable.
- Metadata that promises more than the page. Words such as "guaranteed" or "complete" in the description that the page does not support lead to quick exits.
- Forgetting to update metadata after a rewrite. If you change the title or subtitle, change the tags too.
- Unescaped characters. An ampersand should be written
&and a stray double quote breaks the attribute. - Expecting instant changes. Search engines recrawl pages on their own schedule. Updated metadata can take days or weeks to appear in results. Social platforms cache link previews too, so a changed preview may not show until the cache is refreshed.
Exercises
Exercise
A course page has the H1 "Learn Python in 30 Days: The Complete Beginner Bootcamp for Aspiring Data Analysts and Career Changers". Its title tag is the same text plus " | CodeHub". Name two problems and propose a better title tag.
Show answer
The title tag is far longer than about 60 characters, so search results will cut it off and hide the brand label and possibly the end of the outcome. It is also hard to scan. A better version puts the main outcome first and drops the extra audience words, which belong in the meta description: "Learn Python in 30 Days for Data Analysis | CodeHub". It is about 52 characters. The audience details move to the meta description.
Exercise
Write a meta description of 155 characters or fewer for this subtitle: "A hands-on course for new managers: run your first five one-on-one meetings with a script and feedback checklist." Use the same terms as the subtitle and name a result.
Show answer
One acceptable answer: "A hands-on course for new managers. Run your first five one-on-one meetings with a script and a feedback checklist, and know what to say next." This is about 143 characters. It keeps the audience ("new managers"), the method ("script and feedback checklist"), and the deliverable ("first five one-on-one meetings"), and it adds a result. Any answer under 155 characters that reuses these terms and makes no unsupported promise is correct.
Exercise
You change your course title from "Portfolio Case Studies" to "Write Portfolio Case Studies That Win Clients" but the Google result still shows the old title two days later. Is something wrong, and what should you check?
Show answer
Probably nothing is wrong. Search engines recrawl pages on their own schedule, so changes can take days or weeks to show. Check that the new title is in the live page's <title> tag (view the page source), that the H1 matches it, and that the page is not blocked from crawling. You can also ask the search engine to recrawl the page through its webmaster tools. Social platforms cache link previews separately and may need a manual refresh.