Lesson · Beginner

Metadata basics

Give a page a truthful title, concise description, encoding, viewport behavior, and canonical identity without unsupported SEO claims.

Published
Last checked

Essential metadata

Metadata helps browsers and retrieval systems identify and present a page. It does not guarantee ranking, indexing, or a particular search snippet.

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Bike repair services in Harbor Point</title>
  <meta
    name="description"
    content="See tune-up and repair services, typical turnaround, and booking options."
  />
  <link rel="canonical" href="https://example.com/services" />
</head>

Use a unique, descriptive title for the page. Write a description for the reader rather than repeating keywords. The canonical URL should identify the preferred version and normally refer to the current public page.

Common mistakes

  • Reusing one title across every page.
  • Claiming a canonical forces a search engine to choose it.
  • Publishing preview URLs as production canonicals.
  • Adding metadata that contradicts visible content.

How browsers and crawlers behave

The browser uses the title for tabs, history, and bookmarks; viewport metadata controls the initial mobile layout viewport; encoding affects byte decoding. Description and canonical metadata are primarily hints to retrieval and sharing systems. A crawler can select another title, snippet, or canonical when signals conflict.

Metadata discovered only after unreliable client execution may be delayed or missed by some consumers. Server-render or statically generate essential title, description, canonical, robots, and social metadata, then keep it consistent with visible content and response status.

Decisions and trade-offs

Write the title for identification: page subject first, then a concise site name when useful. Write a description that summarizes the distinct value without promising a ranking or repeating a keyword list. Self-reference the preferred production URL with an absolute canonical when duplicate URL variants can exist.

Use noindex for previews, private utility results, and post-purchase pages that should not appear in search. Do not block a noindexed page in robots rules before a crawler can read the directive. Sitemaps contain canonical, indexable, successful pages—not every route the application can render.

Accessibility consequences

Titles help screen-reader and keyboard users orient after navigation and distinguish tabs. The viewport declaration allows a layout to use device width; the CSS must still reflow. Metadata never repairs poor visible headings, ambiguous links, or hidden content.

Social preview images and titles need the same truthfulness as the page. Avoid placing essential claims only in an image where they cannot reflow or be verified in visible text.

Common failure diagnosis

  • Every page shares one search title. A template never consumed page data. Generate unique values and enforce uniqueness in the build.
  • The canonical points to preview. Host configuration leaked into metadata. Validate the absolute production base in the release environment.
  • A noindex page appears in the sitemap. Discovery sources use different registries. Derive both from the same validated indexability record.
  • A mobile page is tiny. Viewport metadata is missing or wrong. Add the standard width declaration and repair responsive CSS.

Verify it

Inspect the rendered head on the real URL, not only component source. Confirm one title, one absolute canonical, the expected robots directive, encoding, and viewport. Compare the title and description with the visible heading and body. Request alternate hosts and paths to verify redirect and canonical behavior. Run the sitemap parity check, test a representative social preview, and inspect the raw response with JavaScript disabled.

Exercise and next step

Write a title and description for a contact page. Compare them with the visible heading and confirm they promise only what the page actually provides. Next, apply page-specific metadata consistently across a multi-page site.

Boundary of this lesson

Metadata cannot substitute for an independently useful page, correct response, or coherent internal links. It also cannot guarantee a chosen search title, snippet, canonical, rich result, or indexing date. Treat these declarations as truthful machine-readable summaries of visible content. When production facts change, update both surfaces and the substantive review date together; changing only a timestamp or description creates an appearance of freshness without new evidence.

Practice across environments

Build one page in local, preview, and production environments. Inspect the raw head in each and compare origin, canonical, robots directive, title, description, and social URLs. Preview must not advertise itself as the production canonical or become indexable. Production must not inherit preview noindex. Record the environment rule that selects each value so the result is deterministic rather than a manual release edit.

After deployment, request the page through both the canonical host and every known alias. Compare status, redirect chain, final canonical, robots directive, and social URL. A correct source template is insufficient if the host serves a duplicate or preview header changes indexing behavior. Save the inspected URL with the release evidence.

Free template + launch checklist

Build a page you can check before launch

Start with one reviewed semantic HTML page, then work through the one-page checklist against your published URL.

Check your inbox and confirm before the download arrives. No account required. We do not track email opens. See the privacy notice.