What is the rel=canonical tag?

This blog is hosted in a bunch of places:

I prefer https://jameshfisher.com. The others are old, or insecure, or implementation details. To tell Google and everyone else which version you prefer, you can use the <meta rel="canonical" tag. On every page you serve, you put a <link rel="canonical" href="..."/> element, and this tells the client where the canonical location of that page is. Like so for the page /foo/bar:

<!doctype html>
<html>
  <head>
    <link rel="canonical" href="https://jameshfisher.com/foo/bar"/>
  </head>
  <!-- ... -->
</html>
Tagged .

Similar posts

More by Jim

Want to build a fantastic product using LLMs? I work at Granola where we're building the future IDE for knowledge work. Come and work with us! Read more or get in touch!

This page copyright James Fisher 2017. Content is not associated with my employer. Found an error? Edit this page.