Skip to content
Tutorials Center
My learning

Topics

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

HTML SEO Checklist

A practical HTML SEO checklist: titles, headings, canonical URLs, robots rules, hreflang, links, images and sitemaps, with a script that audits a page.

Search engine optimization (SEO) means helping search engines understand your pages so the right people find them. Much of that work happens outside HTML: good content, fast servers and links from other sites all matter. But the HTML itself decides whether a crawler can read your page, tell which URL is the "real" one, and show a meaningful result in the listing. Getting those basics right costs almost nothing.

This lesson is a checklist you can run on every page. It pulls together ideas from earlier lessons (Page Titles and Descriptions, Meta Tags, Semantic Elements) and adds the pieces that are still missing: canonical URLs, indexing rules, language versions and sitemaps.

How a search engine reads your site

A search engine works in three steps, and your HTML influences each one.

flowchart LR
  A["Crawl<br/>fetch the URL"] --> B["Index<br/>understand and store it"]
  B --> C["Rank<br/>choose and order results"]
  D["robots.txt, links,<br/>sitemap, status codes"] -.-> A
  E["Title, headings, text,<br/>canonical, structured data"] -.-> B
  F["Relevance, quality,<br/>speed, usability"] -.-> C

Crawling finds your pages, indexing decides what each one is about, and ranking decides who sees it.

Nobody can promise a position in the results, and tricks that "game" the system are quickly ignored or punished. What you can do is remove obstacles. Work through the groups below.

1. Basics every page needs

  • A valid document. Start with <!DOCTYPE html>, set the language with <html lang="en">, and declare <meta charset="utf-8"> in the first 1024 bytes.
  • A unique, descriptive <title>. It is the clickable headline in search results. Aim for roughly 50 to 60 characters, put the most important words first, and never reuse one title on two pages.
  • A meta description. <meta name="description" content="..."> is not a ranking factor, but it often becomes the snippet under the title. Write 120 to 160 characters that answer "what will I find here?". Search engines may rewrite it.
  • The viewport tag. <meta name="viewport" content="width=device-width, initial-scale=1"> makes the page usable on phones, and search engines judge the mobile version first.
  • A readable URL. /html/seo-checklist beats /page?id=8472. Use lowercase words separated by hyphens, and keep URLs stable. See URL Encoding for characters to avoid.

2. Structure and content

  • One main heading. Use a single <h1> that matches the page's topic, then <h2> and <h3> in order without skipping levels. Headings are an outline that people and crawlers both use. See Headings and Paragraphs.
  • Semantic landmarks. Wrap the page in <header>, <nav>, <main>, <article> and <footer> instead of anonymous div elements, as shown in Semantic Elements.
  • Real text in the HTML. Put important words in text, not inside images. Content that exists only after heavy JavaScript runs can be indexed later or not at all, so make sure key content is in the HTML the server sends.
  • Descriptive link text. "Read our guide to responsive images" says far more than "click here". The words inside a link tell search engines what the target page is about. See Links in Depth.
  • Alt text on images. A meaningful alt describes the picture for people who cannot see it and for image search. Decorative images get alt="". See Images.
  • Lists, tables and quotes as such. Use the right elements for the right job; they help machines understand your content.

3. Canonical URLs

The same page is often reachable through several addresses: with and without www, with tracking parameters (?utm_source=news), or in a print version. Search engines try to pick one, and you can tell them which with a canonical link:

HTML
<link rel="canonical" href="https://www.example.com/html/seo-checklist">

Rules of thumb:

  • Use an absolute URL, including https://.
  • Put it in the <head>, once per page.
  • Make each page point to itself (a self-referencing canonical) unless it is a deliberate duplicate of another page.
  • Never point to a URL that redirects or returns an error.

The canonical link is a strong hint, not a command. Consistent internal links and redirects (for example from http to https) back it up.

4. Telling crawlers what to do

Two different tools exist, and mixing them up is a classic mistake:

Tool Where What it controls
robots.txt /robots.txt at the site root Which URLs crawlers may fetch
<meta name="robots"> or the X-Robots-Tag header In the page or response Whether a fetched page may be indexed or its links followed

A simple robots.txt looks like this:

TEXT
User-agent: *
Disallow: /admin/
Disallow: /search

Sitemap: https://www.example.com/sitemap.xml

To keep a page out of search results, use <meta name="robots" content="noindex"> and let crawlers fetch the page. If you block it in robots.txt, the crawler never sees the noindex rule, and the URL can still appear if other sites link to it. Also remember that robots.txt is public and is not a security tool; never use it to hide private pages. Protect those with a login.

Use noindex for thank-you pages, internal search results, staging copies and thin utility pages. Do not use it on pages you want found.

Links can carry hints too. Add rel="nofollow", rel="sponsored" (paid links) or rel="ugc" (links in user-written content) to links you do not want to vouch for.

5. Language and regional versions

If you publish the same content in several languages, tell search engines how the versions relate with hreflang links:

HTML
<link rel="alternate" hreflang="en" href="https://example.com/en/pricing">
<link rel="alternate" hreflang="de" href="https://example.com/de/preise">
<link rel="alternate" hreflang="x-default" href="https://example.com/pricing">

Rules:

  • Every version lists all versions, including itself. The links must be reciprocal: if the English page points to the German one, the German page must point back.
  • Language codes follow ISO 639-1 (en, de), optionally with a region (en-GB, pt-BR).
  • x-default names the page for visitors whose language you do not cover.
  • Also set a matching lang attribute on each page's <html> element.

6. Sitemaps

A sitemap is an XML file that lists the URLs you want crawled. It helps most on big sites, new sites with few incoming links, and sites with pages that are hard to reach by clicking. A minimal one:

XML
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://www.example.com/html/seo-checklist</loc>
    <lastmod>2026-03-14</lastmod>
  </url>
</urlset>

List only canonical, indexable URLs that return a normal page, keep lastmod honest, and mention the sitemap in robots.txt (as above) or submit it in the search engine's webmaster tool. A sitemap supports your link structure; it does not replace it. Every important page should also be reachable through ordinary navigation links.

7. Speed, mobile and enhancements

  • Fast pages rank and convert better. Set width and height on images, lazy-load images below the fold and avoid blocking scripts, as taught in Fast-Loading HTML and Loading Resources Efficiently.
  • Responsive design so the page works on small screens: see Responsive Web Design and Responsive Images.
  • Structured data (JSON-LD) can unlock rich results such as star ratings and breadcrumbs: see Structured Data.
  • Social previews with Open Graph tags improve how shared links look: see Social Sharing Previews.
  • HTTPS everywhere, and proper status codes: 200 for pages that exist, 301 for permanent moves and 404 for pages that are gone. A page that says "not found" but returns 200 confuses crawlers.

Auditing a page with a script

Many checks above can be automated. The example below parses a sample page with DOMParser and checks the basics. In your own work you would run a similar script, or a tool such as Lighthouse, on real pages. Edit the sample HTML, break a rule on purpose and run again.

A tiny SEO audit

Two checks fail on purpose: one image has no alt, and one link says "click here". Fix the sample so every line shows PASS.

A one-page checklist

Before you publish a page, ask:

  1. Is the <title> unique, descriptive and short enough?
  2. Is there a useful meta description?
  3. Does the page have exactly one <h1> and a logical heading order?
  4. Is there a self-referencing absolute canonical link?
  5. Should the page be indexed? If not, does it have noindex and not a robots.txt block?
  6. Do all images have fitting alt text and dimensions?
  7. Are the links descriptive, and is the page linked from somewhere else on the site?
  8. For multilingual sites: are hreflang links reciprocal and lang set correctly?
  9. Is the page in the sitemap, served over HTTPS and fast on a phone?

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. You want a page removed from search results. What is the correct approach?

    A crawler has to fetch the page to see its noindex rule. A robots.txt block stops the fetch, so the URL may stay in results.
  2. 2. Which statement about the canonical link is correct?

    <link rel="canonical"> belongs in the head and should use a full absolute URL. It is a strong hint about which address is the preferred one.
  3. 3. What must be true for hreflang annotations to work properly?

    Every language version lists all versions, including itself, so each pair of pages points to each other.
  4. 4. Which link text helps SEO the most?

    Descriptive link text tells people and search engines what the target page is about.
  5. 5. What does a sitemap do?

    A sitemap is a discovery aid. It does not force indexing and does not block anything.

Summary

  • Each page needs a valid structure, a unique <title>, a helpful description, the viewport tag, lang and a single clear <h1>.
  • Use semantic elements, real text, descriptive link text and meaningful alt attributes.
  • Add a self-referencing absolute rel="canonical" link; use robots.txt to control crawling and noindex to control indexing, never both for the same URL.
  • Connect language versions with reciprocal hreflang links, and list canonical URLs in an XML sitemap.
  • Speed, mobile layout, HTTPS, structured data and honest status codes support everything above.

Next lesson: The style Attribute, where the tutorial moves from page metadata to changing how elements look.