Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
.babelrc
.gitignore
.npmignore
CHANGELOG.md
README.md
index.js
package.json

README.md

gatsby-plugin-canonical-urls

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.

Install

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

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-canonical-urls`,
    options: {
      siteUrl: `https://www.example.com`,
    },
  },
]

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

<link rel="canonical" href="https://www.example.com/about-us/" />
You can’t perform that action at this time.