Canonical URLs in Yoast SEO

Last update: 16 August, 2018

Yoast SEO adds canonical URLs to most pages in your WordPress install. It does this automatically and in 99.9% of cases you don’t have to change anything about them. If you do want to change them, there are several ways of doing so:

Change the canonical for an individual article with Yoast SEO

On the advanced tab of the Yoast SEO metabox, you can change the canonical to point to any URL.

  1. Log in to your WordPress website. When you’re logged in, you will be in your ‘Dashboard’. On the left-hand side, you will see a menu. Navigate to the individual article to edit the content settings.
  2. In the Yoast SEO metabox, click on the ‘Advanced’ gear icon.
  3. Enter the full canonical URL.
  4. Update the article.

Canonical elements for paginated archives

A common misconception is that the canonical on a paginated page should always point to page 1 in the series. This is not the case. When you do that, you run the risk of search engines not indexing links that appear on page 2, 3 etc. of your archives. This would cause older articles to drop out of the search results entirely.

Of course, you can change the canonical element of a category, tag or other taxonomy archive to point at another page. To do this, go into the taxonomies settings and set the canonical:

Change the canonical for paginated archives with Yoast SEO

  1. Log in to your WordPress website. When you’re logged in, you will be in your ‘Dashboard’. On the left-hand side, you will see a menu. Navigate to the archive taxonomy, like category or tags, to edit the paginated archive item.
  2. Under the ‘Yoast SEO Settings’ section, enter the full canonical URL.
    yoast seo canonical taxonomy archive
  3. Click ‘Update’.

Developer filter

If you want, you can also filter the output of the canonical programmatically. To do this you can use the wpseo_canonical filter. If you return false on that, no canonical will be output. Some examples can be found here.

Was this article helpful? ·