×

html · level 3 · unit 4 · lesson 3

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

rel="canonical" names the one true address of a page.

One page can often be reached through many addresses: with or without www, or with ?ref=email added by a newsletter. To a search engine, each one looks like a , and the page's place in the results gets split between them.

Choose one , the real home of the page, and name it in the head with <link rel="canonical" href="...">. Search engines then gather everything under that one address.

Always write the full URL, starting with https://. Every copy of the page carries the same canonical link, and the real page points to itself.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Lemon drizzle cake recipe | Bake Street</title>
    <link rel="canonical" href="https://example.com/recipes/lemon-drizzle">
  </head>
  <body>
    <h1>Lemon drizzle cake</h1>
  </body>
</html>

Press show my page to see it here.

Whether someone arrives from a newsletter or a search, this page always names the same home.