SEO & meta tags
6 min lesson
- SEO (Search Engine Optimization) is the practice of helping search engines understand and rank your page.
- Good HTML structure, clear titles and real content matter more than any single meta tag.
- A unique <title> per page and a short meta description are the two meta tags with the most visible effect.
- Headings, alt text, internal links and fast loading all feed into SEO.
- Think of a search engine as a librarian: it reads the labels and summary on each book (title, description, headings) to decide what it is about.
- This builds on Keyboard navigation & focus management: accessible pages are also easier for search engines to read.
- The example sets a title, description and Open Graph tags; you will see a clear tab title and share preview.
- Next, Structured data: microdata & JSON-LD gives search engines even more detail.
- Write a unique title and description for every page.
- Use real headings and descriptive link text; search engines read them.
- Add alt text to images; it helps both users and search.
- Do not stuff keywords; clear, honest content ranks better.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The page title: shown in the tab and in search results -->
<title>How to bake bread at home | My Kitchen</title>
<!-- A short, honest description for search results -->
<meta name="description" content="A step-by-step guide to baking your first loaf of bread at home, with simple ingredients.">
<!-- Open Graph tags control the preview on social media -->
<meta property="og:title" content="How to bake bread at home">
<meta property="og:description" content="A step-by-step guide for beginners.">
<meta property="og:type" content="article">
</head>
<body>
<!-- One main heading that matches the page topic -->
<h1>How to bake bread at home</h1>
<p>Follow these steps to bake your first loaf.</p>
</body>
</html>What happens: A browser tab titled "How to bake bread at home | My Kitchen", a page showing the heading "How to bake bread at home" and the paragraph "Follow these steps to bake your first loaf.", and a share preview using the Open Graph tags.
Breaking it down
title
<title>How to bake bread at home | My Kitchen</title>The clickable headline in search results. It should be unique and describe the page in a few words.
description
<meta name="description" content="...">The snippet below the title in search results. It does not change the page but affects clicks.
og:title
<meta property="og:title" content="...">The title shown when the page is shared on social media. Without it, platforms guess.
h1
<h1>How to bake bread at home</h1>The page's main heading. Search engines read it to understand the main topic.
SEO-related tags
| Tag | Effect |
|---|---|
| title | Clickable headline in search |
| meta description | Snippet below the title |
| og:title | Title on social shares |
| og:image | Image on social shares |
| link rel=canonical | The preferred URL of the page |
A helpful analogy
A search engine is like a librarian skimming a book: the title, description and chapter headings tell it what the book is about. Clear labels make the book easy to shelve and recommend.
Nesting rules
- 1.Use one h1 per page and keep it aligned with the title.
- 2.Never repeat the same title and description on many pages; each should be unique.
Common mistakes
Copying the same title on every page
Avoid
<title>My Site</title> on all pagesUse instead
<title>Contact | My Site</title> on the contact pageIdentical titles make pages hard to tell apart in search results, so users and search engines get confused.
Keyword stuffing
Avoid
bread bread bread best bread cheap breadUse instead
A clear, helpful guide to baking bread at homeSearch engines detect unnatural repetition and may rank the page lower. Honest content wins.
Quick tips
- •Keep titles around 50-60 characters and descriptions around 150-160 characters.
- •Check your page in a search preview tool; it shows exactly how it will look in results.