Quick summary
Adding a canonical tag in WordPress tells search engines which version of a page is the preferred one, preventing duplicate content issues. Using the Yoast SEO plugin, you can set a canonical URL directly from the WordPress post or page editor without touching any code.
Steps
- Go to Plugins in your WordPress dashboard.
- Search for Yoast in the plugin directory and click on it.
- Click Activate to enable the Yoast SEO plugin.
- Open the post or page where you want to add the canonical tag.
- Scroll down to the SEO section below the content editor.
- In the Yoast settings box, navigate to the Advanced tab.
- Enter the preferred canonical URL in the canonical URL field.
- Click Update to save your changes — the canonical tag will now be embedded in the HTML of that page.



