How to force links to open in a new window

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only. This article only applies to Atlassian products on the server and data center platforms.

The information on this page relates to customisations. Consequently, Atlassian Support cannot guarantee to provide any support for the steps described on this page as customizations are not covered under Atlassian Support Offerings. Please be aware that this material is provided for your information only and that you use it at your own risk.

A feature request has been created at CONF-11194 - Getting issue details... STATUS , for interested parties. For more information on how new features are implemented, please see our Implementation of New Features Policy.

A 3rd party plugin is available that reproduces some of this functionality.


By default, links are opened in the same window. To force them to be opened in a new window, follow these steps:


This customization will only work for Confluence 3.0.1 and above

  1. Visit Administration >> Custom HTML
  2. Click Edit
  3. In the At end of the HEAD field, insert this code:
    • For external links only, like []:

      jQuery(document).ready(function() {
          jQuery(".external-link").attr("target", "_blank");
    • For all type of links (internal and external):

      jQuery(document).ready(function() {
          jQuery(".wiki-content a").attr("target", "_blank");
  4. Hit Save

If you'd like to use this functionality on a single page rather than the whole instance, enable the HTML Macro and embed this script in your page.

Last modified on Dec 7, 2021

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.