How to make confluence links all open in new window

Hi Atlassian,

We want to insert links to external websites in my page and have them open up in a new window. (It's not just ctrl+click).

We want all links to open in a new tab, window. Please support us.
My Confluence 6.0.0-OD-2016.12.2-1113.

Thanks so much,


2 answers


You can add some javascript to apply the target="_blank"  attribute to all links so that they open up in a new window. If you want to target only links that lead to external sites, you can use the class ".external-link" which confluence applies to all links that are external.

For example, add something like this to the custom HTML section in the admin area:

 AJS.$(".external-link").attr("target", "_blank");



Steven Behnke Community Champion Mar 28, 2016

The user indicates with labels they are on Confluence Cloud – Custom HTML and jquery is not an option.

Oh good point, didn't see that. Not sure how it can be done globally without Javascript then.

 I also don't know of any way to do it in cloud. So you might want to vote for this:

you can't, we've all been sent back to 1997.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

259 views 2 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you