Wagtail Wagtail + CodeRed Extensions
  • Getting Started
    • Installation
    • Customize the design of your website
    • Tutorial Part 1: Site Name, Logo, and Basics
    • Tutorial Part 2: Adding Content
    • Tutorial Part 3: Navbar & Footer
    • Tutorial Part 4: Creating a Blog
    • Tutorial Part 5: Web Page
    • Tutorial Part 6: Create Categories with Classifiers
    • Tutorial Part 7: Forms & Contact Pages
    • Tutorial Part 8: SEO Metadata
    • Tutorial Part 9: Images
    • Tutorial Part 10: Password-Protected Pages
  • Advanced Tutorial
    • Customizing HTML/CSS in Templates
    • Custom Page Types
  • Features
    • Blocks
      • Content Blocks
        • Button Block
        • Card Block
        • Carousel Block
        • Download Block
        • Embed Media Block
        • Google Map Block
        • HTML Block
        • Image Block
        • Image Gallery Block
        • Image Link
        • Latest Pages Block
        • Modal Block
        • Page Preview Block
        • Price List Block
        • Reusable Content Block
        • Quote Block
        • Table Block
        • Text Block
      • Layout Blocks
        • Card Grid Block
        • Column Block
        • Hero Block
        • Responsive Grid Row Block
    • Import/Export
    • Mailchimp Integration
    • Page Types
      • Article Pages
      • Event Pages
      • Form Pages
      • Location Pages
      • Stream Forms
      • Web Pages
    • Searching
    • Snippets
      • Carousels
      • Classifiers
      • Content Walls
      • Footers
      • Navigation Bars
      • Reusable Content
  • How-To Guides
    • Customize Navbar and Footer
    • Add Tracking Scripts
    • Open External Links in New Tab
    • Translation & Multi-Language Support
    • Run Wagtail CRX with Docker
    • Using a Custom Image Model in Wagtail CRX
    • Convert Existing Site to Use a Custom Image Model
  • Technical Reference
    • Wagtail CRX Django Settings
  • Contributing
  • Release Notes
    • v0.23.0 release notes
    • v0.22.3 release notes
    • v0.22.2 release notes
    • v0.22.1 release notes
    • v0.22.0 release notes
    • v0.21.1 release notes
    • v0.21.0 release notes
    • v0.20.0 release notes
    • v0.19.1 release notes
    • v0.19.0 release notes
    • v0.18.2 release notes
    • v0.18.1 release notes
    • v0.18.0 release notes
    • v0.17.0 release notes
    • v0.16.3 release notes
    • v0.16.2 release notes
    • v0.16.1 release notes
    • v0.16.0 release notes
    • v0.15.2 release notes
    • v0.15.1 release notes
    • v0.15.0 release notes
    • v0.14.1 release notes
    • v0.14.0 release notes
    • v0.13.3 release notes
    • v0.13.2 release notes
    • v0.13.1 release notes
    • v0.13.0 release notes
    • v0.12.1 release notes
    • v0.12.0 release notes
    • v0.11.0 release notes
    • v0.10.0 release notes
    • v0.9.1 release notes
    • v0.9.0 release notes

Get Pro Support
This project is commercially supported by CodeRed.

  1. Docs
  2. How-To Guides
  3. Open External Links in New Tab
Edit on GitHub View source

Open External Links in New TabΒΆ

A common requirement by marketing teams is to force external links to open in a new tab, rather than to navigate the current tab. Wagtail has strong opinions against this practice, hence Wagtail does not provide the ability to set the target attribute of links in rich text fields. But, the reality of the matter is that not everyone shares this opinion.

Wagtail CRX provides a setting that will use JavaScript to open all external links, meaning any link not on the current domain, to open with target='_blank':

Settings > General > Open all external links in new tab

← Add Tracking Scripts Translation & Multi-Language Support  β†’
  • Wagtail Hosting by CodeRed
  • Wagtail CRX on GitHub
  • About CodeRed

Wagtail Sphinx Theme 5.1.1

© Copyright 2018–2022, CodeRed LLC