Confluence hyperlink which open a new tab or a new window

Hi all,

i have been finding ways to do hyperlink in confluence which open a new tab or new window browser, but i fail to find one.

Is it possible to be done? because i cannot find it in this link

Can anybody help me?

10 answers

1 accepted

35 votes
Accepted answer

It's a fairly common need depending on what you need to reference when building documents in confluence. The last thing you want to do is pull people from confluence on every link when you're sending someone to a reference for quick review.

I would like to see an improvement added where you can simply define whether the link is to open in the current window (use the current method) or open in a separate window/tab (add some form of anchor like ^ to the end of the current method).

I agree with Steve, make it a simple flag on the link macro params.

I'm so sure I've seen this feature in an Atlassian product, I thought it was confluence, but I must be mistaken, but a simple tickbox with "open in new window" would be perfect.

Like 1 person likes this

To Confluence Product team: Why on earth in the year 2018 and six years after users asked for it this is not a checkbox (per link when it is created) in your product?

It's asinine, really.

Like 4 people like this

and all the 'solved' links lead to the same answer - no good if not an admin and not for OnDemand.

Like 1 person likes this

You are right Julian. When it comes to a Cloud product, they have to be extra diligent on the security of that product. If someone were to write something that caused a vulnerability, it wouldn't just affect the one customer, but probably all of their customers.

We use the Server product on our end and that allows me to customize as needed without the restrictions Atlassian has set on the Cloud versions. This does come with it's own burdens though too (product updates, general maintenance, add-on updates... depending on how you use it, it can be a fair list).

Like 1 person likes this

Thanks Steven.

Still doesn't explain why in 6 years they couldn't have provided this simple feature for all users.

Ah well, we two-finger, or right-click, onwards.

Like 1 person likes this

Agreed! Good luck

Like 1 person likes this

Seriously!!!  YES!!!!!  Please add this ability.

Like 2 people like this

I agree .... this is SOOOO needed!

...hare to believe that it's 2019 and NO action on this issue.

Like 1 person likes this

Keep increasing my licensing costs but cannot open a link in a new window. Right...

Hi Septa,

Thanks for your help.

The code works like magic :)

Atlassian Rox!

This did not work for me.  I tried adding both target="_blank" and _target="_blank"_ to the anchor tag.  The first did not result in a new window.  The second resulted in the following error when I tried to apply the source code change: 

Element type "a" must be followed by either attribute specifications, ">" or "/>". (400)

I also found this Atlassian article, which uses the HTML macro.  However, my company does not apply the HTML macro for security reasons.

Finally, I cannot add a user macro as suggested in another reply, because (1) my company prohibits user macros and  (2) I am not an admin.

II do not understand why I cannot use the standard html code <a href="" target="_blank"> or the Atlassian suggested variantion, <a href="" _target="_blank"_>.


My company is running Confluence Server 5.9.  

The only HTML macros I have available are HTML Table, HTML Comment and HTML Image.  

But, for "OnDemand" versión: How can I add this hack?


I am having the same problem! How to add a hack to allow me to open up link in a new window using "on demand" version of Confluence?

Is there any way to accomplish this if you aren't an Admin?

you could create a user macro that you'd use instead of a regular link

This is not available for OnDemand

Thank you for your answer @Andrei but I think that community champions should approach the community needs differently. Instead of posting a work around, take the matter to your product group and advocate on behalf of the community.

Like 1 person likes this

Is there any way to accomplish this if you aren't an Admin?

You can do an HTML macro and add something like...

<a href="" target="_blank">Your Site</a>


If you have to make it inline (like within a paragraph), then you can add something a little more complex like...

<p>This is a site for you to check out: <a href="" target="_blank">Your Site</a>. (This will open in a new tab)</p>
3 votes
Ann Worley Atlassian Team Jun 21, 2018

Hi, just wanted to let everyone know there is a Suggestion open for this functionality: Provide the ability to create a link in Confluence that will open in a new tab.

Please check out the comments on the ticket and feel free to weigh in with your use cases to communicate directly with the development team.

Voting or commenting also adds you to notifications, so you can follow the status.

Which is a duplicate of which is marked as resolved "won't fix". 


Hi Steven and David, 

Thank you for your quick replies. Even though the macro add-on would solve the problem, I think it is too much to pay an extra 6$ a month just to be able to open a link in a new tab. I wish Atlassian would just add a checkbox "open in new tab" like any other programme...!

The confluence documentation explains this, though not perfectly clearly:


 -Edit the page with the link which you wish to open to an external page.

-Click the '+' then 'other macros' search for 'html' and select the black icon [Bob Swift]

then paste the following:

jQuery(document).ready(function() {
    jQuery(".external-link").attr("target", "_blank");


Then click on the 'Open in Source Editor' button < > at the top right of the editing page.

For every link, add the attribute class="external-link" within the <a> tag

<a class="external-link" href="">Google</a>  


Thank you @Alex, this is very kind of you to research and offer this. But it is absolutely not an acceptable solution Atlassian wise. I don't any anyone doing this ten times a day, or even twice while they should be focused on content.

Like 1 person likes this

Here's another solution not targeting every link on a page :)


Use the HTML macro element to manually create you links in HTML.


Edit mode



View mode



I have tried using David's solution to open a link in a new tab, however I cannot find the option to add a HTML macro to my Atlassian article.  The only thing I found is "HTML comment", however this does not appear on the published page. Could anyone help me? 

Thanks a lot in advance!


As far as I know, administrators manage which macros are available.

It is not without security risks to use the HTML macro, as it opens up for e.g. cross-site scripting, thus your administrator might have disabled it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

1,436 views 110 8
Join discussion

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