Configure Canonical URLs in Magento
Configuring canonical URLs in Magento helps prevent duplicate content issues by specifying the preferred version of a webpage. This can improve your SEO by consolidating page authority and directing search engines to the primary version of a page.
Steps to Configure Canonical URLs in Magento
Enabling Canonical URLs for Products and Categories
-
Log in to the Magento Admin Panel:
- Open your web browser and navigate to the URL of your Magento admin panel.
- Enter your admin username and password, then click on "Sign in."
-
Navigate to the SEO Settings:
- In the left sidebar, go to Stores > Configuration.
- In the Catalog section, click on Catalog.
-
Enable Canonical URLs for Products:
- Expand the Search Engine Optimization section.
- Set Use Canonical Link Meta Tag For Products to "Yes".
-
Enable Canonical URLs for Categories:
- Set Use Canonical Link Meta Tag For Categories to "Yes".
-
Save the Configuration:
- Click Save Config to apply the changes.
Configuring Canonical URLs for Custom Pages
-
Navigate to CMS Pages:
- In the left sidebar, go to Content > Elements > Pages.
-
Edit a CMS Page:
- Find the page you want to add a canonical URL to and click on it to edit.
-
Add Canonical URL in the Layout Update XML:
- In the Design tab, find the Layout Update XML field.
- Add the following XML code to specify the canonical URL:
<reference name="head"> <action method="addLinkRel"> <rel>canonical</rel> <href>{{canonical_url}}</href> </action> </reference>
- Replace
{{canonical_url}}
with the actual URL you want to set as canonical.
-
Save the Page:
- Click Save to apply the changes.
Using a Third-Party Extension for Advanced Canonical URL Management
For more advanced canonical URL management, you might consider using a third-party extension. Some popular options include:
- SEO Suite Ultimate by Mageworx
- Advanced SEO Suite by Mirasvit
Installing and Configuring a Third-Party Extension
-
Choose an Extension:
- Go to the Magento Marketplace and search for a canonical URL management extension.
- Purchase and download the extension.
-
Install the Extension:
- In the Magento admin panel, go to System > Web Setup Wizard > Extension Manager.
- Find the extension you purchased in the list and click Install.
- Follow the on-screen instructions to complete