What is a canonical URL?
A canonical URL is the main (preferred) address of a page, specified to search engines when the same content is available at multiple URLs.
Why it's needed:
If the same text is placed at:
site.com/pagesite.com/page?ref=adssite.com/page/index.html
Google sees this as duplicates. And a canonical URL says: "Here's the main version, count this one for indexing."
What it looks like:
In HTML, this is added to <head>:
html
<link rel="canonical" href="https://site.com/page">Why use it:
- Removes duplicates from search.
- Concentrates SEO weight in one URL.
- Simplifies indexing and ranking.
Without this, pages with identical content can compete with each other, lowering rankings.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.