Community Plugin
View plugin on GitHub


Add canonical links to HTML pages Gatsby generates.

This implementation is primarily helpful for distinguishing between https/http, www/no-www but could possibly be extended to help with when sites add multiple paths to the same page.


npm install --save gatsby-plugin-clean-canonical-urls

How to use

// In your gatsby-config.js
plugins: [
    resolve: `gatsby-plugin-clean-canonical-urls`,
    options: {
      siteUrl: ``,

With the above configuration, the plugin will add to the head of every HTML page a rel=canonical e.g.

<link rel="canonical" href="" />
© 2022 Gatsby, Inc.