A canonical URL is an HTML element used to prevent duplicate content issues in search engine optimization (SEO) by specifying the “preferred” version of a web page.
When multiple URLs have the same or very similar content, search engines might struggle to determine which version to index or rank. By using the canonical link element (<link rel="canonical" href="https://example.com/preferred-page" />
), you can signal to search engines which version should be considered the authoritative or primary one.
For example, a website might have the same content accessible via multiple URLs due to different parameters or session IDs. By specifying a canonical URL, you can consolidate the ranking signals for those pages to the canonical version, helping to improve search engine rankings and avoid potential penalties for duplicate content.