Canonical URL for CMS Page - Magento 2 Website
With the default, Magento set up developer enable to add canonical URL on Product and category page directly using admin panel. Unfortunately, it is not so in the case of CMS pages.
Therefore, M-Connect Media have developed a simple code function to add canonical URL on CMS pages as well. Thus, we can eliminate duplicate content pages issues throughout the Magento 2 website with simple tweaks.
Using the same, it automatically adds canonical URL, as a display in the head. Moreover, it provides two options in bonus, and those are as following:
- It lets you keep trailing slash at the end of the URL
- It lets you remove trailing slash at the end of the URL
Setup
Please download Mconnectmedia_CmsPageCanonicalUrl.Zip from given URL. Now, unzip it, and upload in Magento root directory. After that run below Command.
Run Command List
php bin/magento module:enable Mconnectmedia_CmsPageCanonicalUrl
php bin/magento setup:upgrade
php bin/magento cache:flush
php bin/magento cache:clean
rm -rf var/di var/generation var/cache
Back-end Options
You can access its setting through Admin panel. Easy to use and manage!