DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
← From Beginner to Expert in Fundamentals of Frontend
  • Semantic HTML
  • Accessibility (a11y)
  • Forms & Validation
  • Document Metadata & The <head>
  • The Document Object Model (DOM)
  • Character Encoding & Entities
  • Data Attributes & Custom Data
  • Template, Slot & Web Components
  • Responsive Images: Picture, Source & srcset
  • Loading Strategies & Resource Hints
  • The Native Dialog Element
  • Audio, Video & Media APIs
  • SVG Integration & Canvas Basics
  • Advanced Input Types & Datalist
  • Details, Summary, Progress & Meter
  • Global Attributes & Iframe Security
  • Microdata, Schema.org & Structured Data
  • Open Graph & Social Meta Tags
  • Security Headers & CSP in HTML
  • Link Relations & Canonical Tags
← From Beginner to Expert in Fundamentals of Frontend

Link Relations & Canonical Tags

10 min read
rel=canonicalrel=noopenerrel=noreferrerrel=alternaterel=prev/next

Link Relations: Metadata for Connections

The rel attribute defines the relationship between the current document and the linked resource. Critical for SEO, security, and performance.

Security Link Relations

ValuePurpose
noopenerPrevents new window from accessing window.opener (security)
noreferrerPrevents sending Referer header + includes noopener
nofollowTells search engines not to follow this link

SEO Link Relations

ValuePurpose
canonicalThe primary URL for duplicate content
alternateAlternative versions (language, mobile, RSS)
prev/nextPagination sequence

Why noopener Matters

Without rel="noopener", a link opened with target="_blank" gives the new page access to window.opener — the new page can navigate your page to a phishing URL.

Modern browsers add noopener by default for target=_blank, but explicit is better.

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.