HTML SEO: Helping People Find Your Pages
Most people find a website the same way: they type a question into a search box. If your page is not in the results, it may as well not exist. SEO, short for search engine optimization, is the craft of making your pages easy for search engines to find, understand, and show to the right people.
The good news for beginners: a lot of SEO is just good HTML. A clear title, honest headings, meaningful elements, descriptive links, and useful content all help people, and they help search engines too. This section teaches the HTML side of SEO, one tag at a time, and is honest about what HTML cannot do.
What You Will Learn in This Sectionβ
- How search engines crawl, index, and rank pages
- Writing titles and meta descriptions that people want to click
- Using headings and semantic HTML to show a page's structure
- Using canonical links and robots meta to manage duplicates and indexing
- Adding structured data (JSON-LD) so search engines understand your content
- Controlling how links look when shared, with Open Graph and Twitter Cards
- The basics of international SEO (language and region)
- Which parts of SEO are not in your HTML
The Big Ideaβ
- HTML Code
- Search Preview
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- What the page is called, in search results and tabs -->
<title>Rye Bread Recipe: Easy No-Knead Loaf | The Bread Bin</title>
<!-- The summary that may appear under the title -->
<meta name="description" content="Bake a crusty rye loaf at home with five simple ingredients. No kneading and no special tools.">
<!-- The main address of this page -->
<link rel="canonical" href="https://thebreadbin.example/recipes/rye-bread">
<!-- How the link looks when shared -->
<meta property="og:title" content="Rye Bread Recipe">
<meta property="og:image" content="https://thebreadbin.example/img/rye.jpg">
</head>
<body>
<main>
<h1>Easy No-Knead Rye Bread</h1>
<p>...</p>
</main>
</body>
</html>
How it might look in a search result:
52 characters in the title, 131 in the description.
Looks good. Make sure it is also true and useful.
This is a simple preview. Real search results are cut off by width in pixels, not by characters, and search engines often rewrite titles and snippets to suit each search. The limits here are rough guides, not rules.
Edit the title and the description. Watch the preview change, and see the length hints. Notice how a clear title and an honest summary already look more inviting.
What Is SEO, Really?β
SEO is not a trick to fool a search engine. It is the work of helping a search engine understand your page, so it can match it with people who are looking for it. The goals are simple:
- Be findable: search engines can reach and store your pages.
- Be understandable: they can tell what each page is about.
- Be worth clicking: your result looks clear and trustworthy.
- Be worth staying on: the page is useful, fast, and easy to use.
The fourth one matters most. A search engine's whole job is to send people to pages they will be glad they opened.
Nobody can guarantee a number one ranking, and anyone who does should be treated with caution. SEO takes weeks or months to show results, and results depend on competition, content, and changes that you do not control.
How Search Engines Workβ
Search engines work in stages. Explore each one, and see which HTML helps where.
Choose a stage to see what happens, and which HTML helps.
1. Crawl
A program (a crawler) follows links and downloads your pages. It can only find pages that are linked, listed in a sitemap, or already known.
What helps here:
- Real links with an href
- robots.txt rules
- A sitemap file
- Fast, working pages
If a crawler cannot reach a page, nothing else matters.
A simplified model. Real search engines are more complicated, and each one works a little differently.
Where HTML Helpsβ
HTML is only one part of SEO, but it is the part you fully control, and the part that makes everything else work.
| HTML piece | What it does for SEO |
|---|---|
<title> | Names the page in results, tabs, and bookmarks |
<meta name="description"> | Offers a summary that can appear under the title |
Headings (h1 to h6) | Show the outline and main topics |
| Semantic elements | Show which parts are navigation, main content, and so on |
| Links with clear text | Help crawlers find pages and understand what they are about |
Image alt text | Describes images, and helps image search |
rel="canonical" | Names the main version of a page that exists at several addresses |
| Robots meta | Asks search engines to index or skip a page |
| Structured data | Describes your content in a format machines read well |
| Open Graph and Twitter Cards | Control how the link looks when shared |
lang and hreflang | Say which language and region a page is for |
Where HTML Does Not Helpβ
Honest SEO includes what is outside the page's HTML:
- Content quality. Helpful, original, accurate content that answers a real question is the biggest factor.
- Page experience. Fast loading, stable layout, mobile-friendly design, and HTTPS.
- Links from other sites. Others linking to you is a signal that your page is useful.
- Authority and trust. Real expertise, clear authorship, and an honest site.
- Search intent. Whether your page is the kind of page the searcher wanted.
- Technical setup. Server speed, redirects, sitemaps, and error pages.
A perfect set of tags on a thin, copied page will not get far. And a great page with missing tags can still do well. HTML is the foundation, not the whole building.
White Hat and Black Hatβ
- White hat SEO follows the search engines' guidelines, and helps real people.
- Black hat SEO tries to trick them: hidden keywords, fake links, copied content, misleading titles, and cloaking (showing crawlers something different).
Black hat tricks may work for a little while, but they put your site at risk of being demoted or removed. They also make a worse web for readers. In this course, we only teach the first kind.
Myth or Fact?β
Test what you already believe about SEO:
True or false? Decide each one, then check your answers.
Search engines change their advice over time. Check the official documentation for the search engines you care about.
What Is in This Sectionβ
Foundationsβ
ποΈ HTML SEO Basics
Learn the HTML basics that help search engines find and understand a page: the head essentials, real headings and text, crawlable links, images, clean URLs, mobile and speed basics, and how JavaScript can hide content. Includes a crawler's-view lab, a URL checker, and a live HTML SEO basics checker with a messy and a fixed page.
ποΈ Title (SEO)
Learn how to write page titles that search engines understand and people want to click: matching search intent, placing keywords naturally, choosing patterns for different page types, handling brand names and separators, avoiding stuffing and clickbait, and knowing why search engines sometimes rewrite titles. Includes a title builder, a title duel quiz, and a site-wide title audit.
ποΈ Meta Description
Learn how to write meta descriptions that earn clicks: what they are, why they are not a ranking factor, how search engines choose snippets, the right length, a simple writing formula, and how to avoid duplicates and mistakes. Includes a description writer with desktop and mobile previews, a snippet chooser simulation, and a site-wide description audit.
ποΈ Headings and SEO
Learn how headings help search engines and readers understand a page: the h1 to h6 outline, how many h1 elements to use, writing clear and natural headings, avoiding fake headings and stuffing, jump links, FAQs, and templates. Includes a live heading outline checker, a heading level sorter, and a heading duel quiz.
ποΈ Semantic HTML and SEO
Learn how semantic HTML helps search engines and other tools understand a page: main content versus boilerplate, landmarks, articles, sections, figures, dates, lists, tables, and breadcrumbs. Be honest about what semantics do and do not do for ranking. Includes a live semantic page analyzer, an element picker quiz, and a breadcrumb builder with matching structured data.
ποΈ Canonical Links
Learn how rel=canonical tells search engines which address is the main version of a page. Understand duplicate URLs, self-referencing canonicals, cross-domain canonicals, redirects versus canonicals versus noindex, pagination, parameters, and common mistakes. Includes a URL normaliser, a canonical decision quiz, and a live canonical checker.
ποΈ Robots Meta
Learn how the robots meta tag asks search engines to index, skip, follow, or limit snippets for a page, and how it differs from robots.txt, X-Robots-Tag, rel=nofollow, canonical links, and real privacy. Includes a robots meta builder, a robots.txt tester that shows which rule wins, and a live robots meta checker that catches typos and conflicts.
ποΈ Structured Data
Learn structured data with JSON-LD and schema.org: what it is, which types to use (Article, Recipe, Product, FAQPage, Event, BreadcrumbList), the honesty rules, how to escape it safely, and how to test it. Includes a JSON-LD builder for five types, a live JSON-LD checker that compares markup with visible text, and a which-type quiz.
ποΈ Open Graph
Learn Open Graph tags: the four essential properties, og:type and article extras, how to choose and size a share image, absolute URLs, fallbacks, caching, and why scrapers need tags in the server HTML. Includes an Open Graph builder with a share-card preview, an image crop lab, and a live Open Graph checker.
ποΈ Twitter Cards
Learn Twitter Card tags, used by X for link previews: the card types, twitter:card, title, description, image, alt text and handles, how they fall back to Open Graph, image sizes, caching, and why robots.txt must allow the crawler. Includes a card builder with previews, a fallback lab that shows which tag wins, and a live Twitter Card checker.
ποΈ International SEO
Learn the basics of international SEO with HTML: the lang attribute, hreflang alternate links, language and region codes, x-default, reciprocal links, URL structures, canonical links for each version, and good localisation habits. Includes an hreflang builder with sitemap output, a return-link matrix that finds missing links, and a live hreflang checker.
Tools You Will Useβ
- Google Search Console (free): shows which pages are indexed, which searches find you, and any problems. Bing Webmaster Tools is the equivalent for Bing.
- Lighthouse (in Chrome DevTools): checks basic SEO, speed, and accessibility.
- Rich Results Test and Schema Markup Validator: test your structured data.
- Your browser's "view source" and developer tools: see what a crawler gets in your HTML.
- A site search for your own pages (the
site:operator in many search engines) to see what is listed.
Features and names change, so check each tool's current documentation.
Five Habits to Start Todayβ
- Give every page a unique, clear title. Say what the page is.
- Write for people first. Answer one real question well.
- Use real headings and links. Describe where each link goes.
- Add alt text to images that carry meaning.
- Check what search engines see. Use Search Console and "view source."
SEO Checklist for Any Pageβ
- The page has a
langattribute and a unique<title> - There is a helpful, honest meta description
- There is one clear
h1, and headings follow the outline - The content is in real text, and links have descriptive text
- Images have useful
alttext, and a sensible size - The page has a canonical link, when needed
- The page can be crawled, unless it is meant to be private (and private pages have a login)
- Structured data is valid, and matches visible content
- Social share tags are set (Open Graph and Twitter Cards)
- The page is fast, mobile-friendly, and served over HTTPS
- Language and region are clear, if you serve several
Security and Privacy Notesβ
noindexandrobots.txtare not security. They are polite requests to well-behaved crawlers. Pages that must stay private need a login and proper access control.- Do not publish private data and hope it is not found. Search engines index what they can reach, including old test pages, staging sites, and files in public folders. Check what is public.
- Structured data and reviews must be honest. Fake ratings, fake reviews, or markup that does not match the visible page can lead to penalties, and it can mislead people.
- Be careful with tracking and analytics. Many places require consent for cookies and tracking. Collect the least data you need, and say what you collect. This is not legal advice, so check the rules that apply to you.
- Beware of SEO scams. Emails promising instant first-page rankings, or tools that ask for passwords or access to your Search Console, are often scams. Give out access carefully.
- Watch for spam on your own site. User-generated links and comments can be abused. Use
rel="ugc"orrel="nofollow"where appropriate, and moderate content.
Global Audience Notesβ
- Search engines differ. Google and Bing are common in many places, but Baidu (China), Yandex (Russia and nearby), and Naver (Korea) matter in others. Each has its own guidelines and tools, so check the ones your readers use.
- Write in your readers' language, and say so with the
langattribute. For a multilingual site, read the lesson on International SEO. - People search in different ways. Words, spellings, and phrases differ by language and country, so translate the meaning, not just the words.
- Mobile and slow networks matter. In many regions, most visitors use phones on slower connections. Small, fast pages do better.
- Right-to-left languages and non-Latin scripts need correct
lang,dir, and encoding (UTF-8). - Laws and rules vary by country, including privacy and advertising rules.
Common Mistakes to Avoidβ
- Writing for search engines, not people. Stuffed, awkward text hurts everyone.
- The same title on every page.
- No title, or "Untitled" or "Home" only.
- Keyword stuffing, including in alt text, headings, and hidden text.
- Relying on the meta keywords tag, which major search engines ignore.
- Using headings only for size or style.
- Links that say "click here."
- Using
noindexorrobots.txtas if it were security. - Duplicate pages with no canonical.
- Content that only appears after heavy scripting, with no fallback.
- Chasing tricks, or paying for "guaranteed rankings."
- Never checking Search Console or what is really indexed.
Practice Timeβ
Try these in your browser and your editor:
- Use the search preview. Write a title and description for a page you built, and watch the length hints.
- Open the explorer, and read each stage. Which stage can you influence the most with HTML?
- Take the myth drill. Which answer surprised you?
- Use "view source" on a site you like. Find its
<title>, description, and canonical link. - Search for a topic you know well. Which results look the most trustworthy, and why?
- Open Lighthouse in Chrome DevTools, and run an SEO check on a page you built.
- List every page of a small site you built, and give each page a unique title.
- Check your page with a screen reader. Do the headings and link texts make sense out of context?
- Find one page that you would not want indexed, and decide how to protect it properly.
- Bonus: sign up for Google Search Console (free) with a site you own, and read the "Pages" report.
Quick Recapβ
Click a question to check your answer.
1. What does SEO stand for, and what is it for?
Search engine optimization. It is the work of helping search engines find, understand, and show your pages to the people who are looking for them.
2. What are the main stages of how search engines work?
They crawl (find and download pages), read and render them, index (store and understand) them, rank them for a search, and show a result.
3. Which HTML helps SEO most?
A unique and clear <title>, an honest meta description, real headings, semantic elements, descriptive links, alt text, and, when needed, canonical, robots, and structured data.
4. What can HTML not do?
HTML cannot make poor content good, give you links from other sites, or guarantee a ranking. Content quality, page experience, and trust matter a great deal.
5. Is noindex a way to keep a page private?
No. It only asks search engines not to list the page. Anyone with the link can still open it. Use a login for private pages.
6. What is the difference between white hat and black hat SEO?
White hat follows search engine guidelines and helps people. Black hat tries to trick search engines, and risks penalties.
Key Takeawaysβ
- SEO helps search engines find, understand, and show your pages. Good HTML is where it starts.
- Search engines crawl, index, rank, and show. Different tags help at different stages.
- Titles, descriptions, headings, and links are your core tools.
- Canonical, robots, and structured data guide how search engines treat your pages.
- Open Graph and Twitter Cards shape how links look when shared.
- Content quality and page experience matter more than any tag.
- No one can promise rankings. Beware of tricks and scams.
- Write for people first, and tell the truth.
Start with HTML SEO Basics, and work through the lessons in order.