Confluence: How to force links to open in a new window

by | Apr 15, 2019 | Atlassian, Confluence | 0 comments

A free plugin is available that reproduces some of this functionality.

Purpose

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

Workaround

This customisation 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 [http://www.google.com]:<script> jQuery(document).ready(function() { jQuery(".external-link").attr("target", "_blank"); }); </script>
    • For all type of links (internal and external):<script> jQuery(document).ready(function() { jQuery(".wiki-content a").attr("target", "_blank"); }); </script>
  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.

Contact Us

4733 Torrance Blvd #139, Torrance, CA 90503-4100

email: sales @ easycloudsolutions.com
office: 626-607-4250