In Magento 2 you can enable canonical URLs for products and categories. Setting canonical URLs is a way to direct search engines to a single canonical URL for indexing thus avoiding duplicate content.
To enable canonical URLs in Magento 2, log in to the admin panel, go to Stores > Settings > Configuration, open Catalog, and click Search Engine Optimization. Set both Use Canonical Link Meta Tag for Categories and Use Canonical Link Meta Tag for Products to Yes, then click Save Config.
Magento search for sites running on Magento 2

Steps to Enable Canonical URLs in Magento 2
- Log in to your Magento 2 admin panel.
- click stores->settings-> configuration
- Go to catalog in the left panel.
- Click search engine optimizations
- Set both Use Canonical Link Meta Tag for Categories and Use Canonical Link Meta Tag for Products to yes.

- Click save the config.
The Use Canonical Link Meta Tag for Categories setting applies to category pages, and Use Canonical Link Meta Tag for Products applies to product pages.
What Is a Canonical Link Meta Tag?
A canonical link meta tag (rel=canonical) tells search engines which URL is the preferred version of a page when duplicate versions exist. Pointing search engines to a single canonical URL for indexing helps you avoid duplicate content.





