How to force links to open in a new window
The information in this page relates to customisations. Consequently, Atlassian Support cannot guarantee to provide any support for the steps described on this page as customisations 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-11194Getting issue details... STATUS , for interested parties. For more information on how new features are implemented, please see our Implementation of New Features Policy.
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
- Visit Administration >> Custom HTML
- Click Edit
- 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>
- 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.