gatsby-plugin-canonical-urls

5.14.0 • Public • Published

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 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/" />

Excluding search parameters

URL search parameters are included in the canonical URL by default. If you worry about duplicate content because for example /blog and /blog?tag=foobar will be indexed separately, you should set the option stripQueryString to true. The latter will then be changed to /blog.

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-canonical-urls`,
      options: {
        siteUrl: `https://www.example.com`,
        stripQueryString: true,
      },
    },
  ],
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.15.0-next.00next
5.0.0-alpha-v5.d20221012t101120.570alpha-v5
5.0.0-alpha-drupal-proxyurl.140drupal-proxyurl
4.8.0-alpha-image-service.240image-service
4.6.0-alpha-ts-jit.600alpha-ts-jit
4.23.0-alpha-preview-gh-api.260preview-gh-api
4.23.0-alpha-a5-peer.700alpha-a5-peer
4.23.0-alpha-9689ff.250alpha-9689ff
4.18.0-alpha-drupal-self-reference.180drupal-self-reference
4.15.0-alpha-wp-image-cdn-auth.480wp-image-cdn-auth
4.14.0-alpha-transformer-json.260alpha-transformer-json
3.14.0-alpha-qe-sm.460alpha-qe-sm
3.0.0-v3rc.00v3rc
2.5.0-image-helpers.580image-helpers
2.2.3-unifiedroutes.760unifiedroutes
2.1.6-otp-test.690otp-test
5.14.04,601latest
4.25.01,378latest-v4
3.15.0109latest-v3

Version History

VersionDownloads (Last 7 Days)Published
5.15.0-next.00
5.14.04,601
5.13.17,993
5.14.0-next.20
5.14.0-next.10
5.13.0257
5.14.0-next.00
5.12.0922
5.13.0-next.00
5.11.0390
5.12.0-next.00
5.11.0-next.10
5.10.026
5.11.0-next.00
5.10.0-next.20
5.10.0-next.10
5.9.0150
5.10.0-next.00
5.8.02,114
5.9.0-next.00
5.7.033
5.8.0-next.00
5.6.029
5.7.0-next.00
5.5.06
5.6.0-next.00
5.4.00
5.5.0-next.00
5.4.0-next.10
5.3.02
5.4.0-next.00
3.15.0109
4.25.01,378
5.2.06
5.3.0-next.00
5.0.0-alpha-drupal-proxyurl.140
5.1.00
5.2.0-next.00
5.0.04
5.1.0-next.00
5.0.0-next.20
5.0.0-next.10
4.14.0-alpha-transformer-json.260
5.0.0-next.00
5.0.0-alpha-v5.d20221012t101120.570
5.0.0-alpha-v5.d20221010t183635.510
5.0.0-alpha-v5.d20221007t081809.410
5.0.0-alpha-v5.d20221005t111511.350
5.0.0-alpha-v5.160
4.24.0183
4.25.0-next.00
4.23.0-alpha-a5-peer.700
5.0.0-alpha-v5.260
4.23.025
4.23.0-alpha-preview-gh-api.260
4.24.0-next.00
4.23.0-alpha-v5.260
4.23.0-alpha-9689ff.250
5.0.0-alpha-v5.250
5.0.0-alpha-v5.240
4.22.015
4.23.0-next.00
4.21.035
4.22.0-next.00
4.20.050
4.21.0-next.00
4.18.0-alpha-drupal-self-reference.180
4.19.0117
4.20.0-next.00
4.18.02
4.19.0-next.10
4.19.0-next.00
4.18.0-next.10
4.17.07
4.18.0-next.00
4.16.010
4.17.0-next.00
4.15.00
4.15.0-alpha-wp-image-cdn-auth.480
4.16.0-next.00
4.14.00
4.15.0-next.00
4.14.0-next.20
4.13.018
4.14.0-next.10
4.14.0-next.00
4.12.1310
4.12.00
4.13.0-next.00
4.11.03
4.12.0-next.00
4.10.02
4.11.0-next.00
4.10.0-next.10
4.9.00
4.10.0-next.00
4.8.00
4.9.0-next.00
4.8.0-alpha-image-service.240
4.8.0-alpha-image-service.250
4.7.08
4.7.0-alpha-image-service.760
4.7.0-alpha-image-service.750
4.8.0-next.00
4.6.04
4.6.0-alpha-ts-jit.600
4.7.0-next.00
4.5.04
4.6.0-next.00
4.4.04
4.5.0-next.00
4.3.02
4.4.0-next.00
4.2.07
4.3.0-next.00
4.1.031
4.2.0-next.00
4.0.01
4.1.0-next.00
4.0.0-zz-next.20
3.14.0204
4.0.0-zz-next.10
4.0.0-zz-next.80
4.0.0-next.10
4.0.0-next.00
4.0.0-alpha-9689ff.130
3.14.0-alpha-qe-sm.460
4.0.0-alpha-9689ff.360
4.0.0-alpha-9689ff.340
4.0.0-alpha-9689ff.240
4.0.0-alpha-9689ff.220
4.0.0-alpha-9689ff.170
4.0.0-alpha-9689ff.80
3.14.0-next.20
3.14.0-next.10
3.13.018
4.0.0-alpha-9689ff.50
3.14.0-next.00
4.0.0-alpha-9689ff.270
3.12.00
3.13.0-next.00
3.12.0-next.30
3.12.0-next.20
3.12.0-next.10
3.11.02
3.12.0-next.00
3.10.0519
3.11.0-next.00
3.10.0-next.10
3.9.01
3.10.0-next.00
3.8.02
3.9.0-next.00
3.7.115
3.8.0-next.10
3.7.00
3.8.0-next.00
3.7.0-next.20
3.7.0-next.10
3.6.010
3.7.0-next.00
3.5.021
3.6.0-next.00
3.4.00
3.5.0-next.00
3.3.0166
3.4.0-next.00
3.3.0-next.10
3.2.04
3.3.0-next.00
3.1.053
3.2.0-next.00
3.0.01
3.0.0-v3rc.00
3.1.0-next.10
3.1.0-next.00
3.0.0-next.10
3.0.0-next.00
2.10.0666
2.11.0-next.02
2.9.0305
2.10.0-next.02
2.8.03
2.9.0-next.02
2.7.03
2.8.0-next.02
2.6.07
2.7.0-next.02
2.5.0-image-helpers.580
2.5.00
2.6.0-next.00
2.4.0232
2.5.0-next.00
2.4.0-next.10
2.4.0-next.00
2.3.1354
2.3.121
2.3.116
2.3.1037
2.3.90
2.3.80
2.2.3-unifiedroutes.760
2.3.62
2.3.50
2.3.43
2.3.30
2.3.20
2.3.189
2.3.01
2.2.40
2.2.30
2.2.20
2.2.10
2.2.00
2.1.221
2.1.210
2.1.200
2.1.190
2.1.184
2.1.162
2.1.152
2.1.140
2.1.131
2.1.120
2.1.110
2.1.100
2.1.80
2.1.70
2.1.68
2.1.6-otp-test.690
2.1.6-otp-test.680
2.1.50
2.1.40
2.1.30
2.1.29
2.1.10
2.1.00
2.0.130
2.0.123
2.0.110
2.0.100
2.0.90
2.0.87
2.0.70
2.0.60
2.0.50
2.0.0-rc.20
2.0.0-rc.10
2.0.0-rc.00
2.0.0-beta.30
2.0.0-beta.20
2.0.0-beta.10
2.0.0-beta.00
2.0.0-alpha.20
2.0.0-alpha.80a21f040
2.0.0-alpha.e328d33f0
2.0.0-alpha.8ac171a10
2.0.0-alpha.10
1.0.14-120
1.0.14-110
1.0.14-100
1.0.14-90
1.0.14-80
1.0.14-60
1.0.14-50
1.0.14-40
1.0.14-30
1.1.0-alpha.e9c3027b0
1.1.0-alpha.5421f3830
1.1.0-alpha.523a42860
1.1.0-alpha.5c9569c00
1.0.181
1.0.170
1.1.0-alpha.76793cd80
1.1.0-alpha.4a09f7450
1.1.0-alpha.20252dc30
1.1.0-alpha.95fcd4af0
1.0.14-20
1.1.0-alpha.5f47082e0
1.1.0-alpha.6ad61a130
1.1.0-alpha.84bd71b40
1.1.0-alpha.12622d640
1.1.0-alpha.34eda94b0
1.0.160
1.1.0-alpha.9fe50b000
1.0.150
1.1.0-alpha.f98688ee0
1.0.14-10
1.1.0-alpha.2cbec6d60
1.0.146
1.1.0-alpha.e66c6c9c0
1.0.14-00
1.1.0-alpha.d0b8dd9e0
1.1.0-alpha.067e672c0
1.1.0-alpha.e28a1c8e0
1.1.0-alpha.bb258cb50
1.1.0-alpha.b68b7f5c0
1.1.0-alpha.dd5041530
1.1.0-alpha.9e381f740
1.1.0-alpha.1a8f691e0
1.1.0-alpha.9d4de2a60
1.1.0-alpha.6ab848750
1.0.130
1.1.0-alpha.5182142b0
1.1.0-alpha.32ef58da0
1.1.0-alpha.2b6952170
1.1.0-alpha.53bbd4cd0
1.1.0-alpha.d1544e1b0
1.0.127
1.1.0-alpha.3f307d610
1.1.0-alpha.926cb6da0
1.1.0-alpha.f5c1df610
1.1.0-alpha.7b47e00d0
1.1.0-alpha.aeb055610
1.1.0-alpha.9da1bca10
1.1.0-alpha.e55869160
1.1.0-alpha.8c8224510
1.1.0-alpha.e9df8e570
1.1.0-alpha.03b9df850
1.1.0-alpha.b50f20630
1.1.0-alpha.a0a09c940
1.1.0-alpha.f20ac0ed0
1.0.110
1.0.100
1.0.90
1.0.80
1.0.70
1.1.0-alpha.1460dad90
1.1.0-alpha.5db7a2750
1.1.0-alpha.93f2e2a20
1.1.0-alpha.2e1e77820
1.1.0-alpha.76b327010
1.0.60
1.0.50
1.0.40
1.1.0-alpha.22c8a6f10
1.0.30
1.0.20
1.0.10
1.0.05
1.0.0-beta.7-alpha.594d939c0
1.0.0-beta.7-alpha.7dc2afa20
1.0.0-beta.7-alpha.60d2ce840
1.0.0-beta.6-alpha.320adb170
1.0.0-beta.60
1.0.0-beta.5-alpha.dfde8a100

Package Sidebar

Install

npm i gatsby-plugin-canonical-urls

Weekly Downloads

21,349

Version

5.14.0

License

MIT

Unpacked Size

40.2 kB

Total Files

9

Last publish

Collaborators

  • mlgualtieri-gatsby
  • serhalp-netlify
  • kathmbeck
  • pieh
  • tylerbarnes
  • daniellewgatsby
  • fk