HTML & CSS Interview Question #32

What is the canonical link element?

Forms, Validation, Metadata, Media, Responsive Images & Accessibility Junior Beginner

Quick Interview Answer

A canonical link identifies the preferred URL for a page when substantially similar content may be accessible through multiple URLs. Search engines can use this signal when consolidating indexing and ranking signals.

Detailed Explanation

A canonical link identifies the preferred URL for a page when substantially similar content may be accessible through multiple URLs. Search engines can use this signal when consolidating indexing and ranking signals.

The canonical URL should normally be an absolute, valid URL representing the preferred version of the content. Canonicalization is an SEO signal and does not redirect users.

Code Example

<link rel="canonical"
      href="https://example.com/interview/html-css">