cancel
Showing results for 
Search instead for 
Did you mean: 

Canonical Tag Not Updating After Slug Change

Canonical Tag Not Updating After Slug Change

I use Magento to sell my products, and I recently changed the slug of one of my category pages from "underwear" to "panties" However, the canonical tag still reflects the old URL. It currently shows: <link rel="canonical" href="https://domin.com/underwear" />instead of the updated URL: <link rel="canonical" href="https://domin.com/panties" /> 

I have toggled the Use Canonical Link Meta Tag For Categories and Use Canonical Link Meta Tag For Products settings multiple times to refresh the changes, but the issue persists.

Could you please advise on how to resolve this?

2 REPLIES 2

Re: Canonical Tag Not Updating After Slug Change

The issue you're facing might be due to Magento's cache or your theme overriding the canonical tag. Here’s a quick solution:

Flush Cache: Clear Magento's cache from System > Cache Management or manually by deleting the contents of var/cache.

Reindex Data: Run reindex commands if you have CLI access:

bash
Copy code
php bin/magento indexer:reindex
Check Theme Overrides: Ensure that your theme or any custom modules aren't overriding the canonical tag in the template files (catalog/product/view.phtml or category/view.phtml).

Clear CDN or Varnish Cache: If you use a CDN (e.g., Cloudflare) or Varnish, clear those caches as well.

If the issue persists after trying these steps, consider checking the SEO extensions you’re using as they might be overriding the canonical URL.

Please give kudos if this helps!


@feleshiashbbd7 wrote:

I use Magento to sell my products, and I recently changed the slug of one of my category pages from "underwear" to "panties" However, the canonical tag still reflects the old URL. It currently shows: <link rel="canonical" href="https://domin.com/underwear" />instead of the updated URL: <link rel="canonical" href="https://domin.com/panties" /> 

I have toggled the Use Canonical Link Meta Tag For Categories and Use Canonical Link Meta Tag For Products settings multiple times to refresh the changes, but the issue persists.

Could you please advise on how to resolve this?


 

Re: Canonical Tag Not Updating After Slug Change

Hello @feleshiashbbd7 

 

If the canonical tag in Magento 2 is not updating after changing a product or category slug, here are some steps to troubleshoot and resolve the issue:

 

Reindex: Ensure that your indexers are up to date. You can run the following command:

php bin/magento indexer:reindex

 

Clear Cache: Clear the Magento cache to ensure that the changes take effect:

php bin/magento cache:clean
php bin/magento cache:flush

Check SEO Settings:

Go to Stores > Configuration > Catalog > Search Engine Optimization.

Ensure that "Use Canonical Link Meta Tag For Categories" and "Use Canonical Link Meta Tag For Products" are set to "Yes".

 

Review Custom Code/Extensions: If you have custom modules or extensions that affect SEO or URL handling, they may interfere with the canonical tag. Disable them temporarily to see if the issue persists.

 

Hope it helps !

If you find our reply helpful, please give us kudos.

 

A Leading Magento Development Agency That Delivers Powerful Results, Innovation, and Secure Digital Transformation.

 

WebDesk Solution Support Team

Get a Free Quote | | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789

 

 

Thank You,


WebDesk Solution Support Team
Get a Free Quote | Email | Adobe Commerce Partner | Hire Us | Call Us 877.536.3789


Location: 150 King St. W. Toronto, ON M5H 1J9