How do I set a custom canonical URL in Yoast SEO?

The Citead team, updated

In short. In Yoast SEO for WordPress, open Advanced in the Yoast SEO sidebar, enter the full preferred URL in Canonical URL, and save or publish the content.

Definition: A canonical URL identifies the preferred version of duplicate or very similar content for search engines. As of 17 October 2026, Yoast SEO for WordPress documents a page-level override in the Yoast SEO sidebar under Advanced, in the Canonical URL field.

Key facts

  • Yoast's WordPress instructions require a full URL and saving or publishing the edited content to apply the change.
  • Yoast's canonical URL guide describes automatic canonical tags for pages and archives; canonical handling is included in both Yoast SEO and Yoast SEO Premium.
  • Yoast's functional specification gives a manually specified URL precedence over its default construction rules, including URLs on another domain.
  • Google's canonicalization documentation describes a canonical link as a strong signal when selecting a representative URL for duplicate content.

Where is the page-level override?

According to Yoast's editing instructions, the workflow applies to a Post, Page, Category or Tag:

  1. The editor opens the relevant content in the WordPress dashboard.
  2. The editor opens Advanced in the Yoast SEO sidebar.
  3. The Canonical URL field receives the complete preferred URL, including its protocol and the intended hostname, with or without www.
  4. Publish, Save, or Republish applies the change.

The field contains the destination URL. Yoast generates the HTML link element from that value. Yoast's implementation guide confirms that this workflow avoids manual theme file edits for canonical tags.

How does Yoast construct the default URL?

Yoast's functional specification describes canonical construction from the preferred protocol, hostname and content path. A singular page uses its path, while a homepage at the domain root uses the root URL with a trailing slash. Permalink preferences influence the path; a valid paginated response retains its pagination component.

The specification also sets cleanup rules, including removing repeated slashes and arbitrary query parameters outside the documented cases. Manually supplied canonicals bypass these construction and sanitization rules. The entered value therefore needs the intended spelling, path and trailing slash.

How is the resulting tag checked?

The published page's HTML provides the output to inspect. Google's canonical link documentation places the element inside <head> and recommends absolute URLs. Its example uses this tag:

<link rel="canonical" href="https://example.com/dresses/green-dresses" />

For a Yoast override, the href value is compared with the saved Canonical URL field. This checks the emitted declaration.

If the tag is absent, Yoast's troubleshooting instructions identify noindex, an instruction excluding a page from search indexing, as a cause: Yoast suppresses the canonical on pages marked noindex. Indexability settings therefore belong in the output check.

FAQ

Do I need Yoast SEO Premium for canonical URLs?

Yoast's canonical URL guide states that both Yoast SEO and Yoast SEO Premium include canonical URL handling.

Can I enter a URL on another domain?

Yes. Yoast's functional specification explicitly includes user-specified cross-domain canonical URLs in its override rule.

Can a developer change the canonical programmatically?

Yes. Yoast's canonical API documentation provides the wpseo_canonical filter to change the generated value. Returning false removes canonical output.

Sources

  1. Yoast, "Yoast SEO: Canonical URLs - Functional specification", undated
  2. Yoast, "How to change the canonical URL in Yoast SEO for WordPress", undated
  3. Yoast, "Canonical URLs: definitive guide to canonical tags", 24 November 2025
  4. Google Search Central, "How to specify a canonical URL with rel="canonical" and other methods", undated
  5. Yoast, "Yoast SEO Canonical URLs - API documentation", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark