It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Confluence hyperlink which open a new tab or a new window

Pangianto Pang Aug 02, 2012

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

https://confluence.atlassian.com/display/DOC/Confluence+Wiki+Markup#ConfluenceWikiMarkup-Links

Can anybody help me?

11 answers

1 accepted

40 votes
Answer accepted
Steve Chavez Aug 01, 2013

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).

David Sinur Aug 04, 2013

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

Like # people like this
Adam Saunders Aug 07, 2016

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 René Vlak likes this
Joe Porkka I'm New Here Mar 19, 2019 • edited

As stated In several answers below, the solution that works for non-admin users is to insert an HTML macro.

The normal "Insert Link" will not do this, and Atlassian closed the feature request as "won't fix".

Carla Ann Rowland Apr 05, 2019

Question is the hyperlink to another Confluence page? Is it cloud or server?

If it is Link in new tab is the macro you are looking for. 

In the parameters in the "Link in new tab" has an option where you can target the new window as a location so your other link in a new tab

36 votes
Rahav Dor Feb 13, 2018

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?

Scott Beeson Mar 27, 2018

It's asinine, really.

Like # people like this
Julian Fainlight Jun 20, 2018

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

Like # people like this
Steven Chavez Jun 20, 2018

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 Shawn Connelly likes this
Julian Fainlight Jun 20, 2018

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 # people like this
Steven Chavez Jun 20, 2018

Agreed! Good luck

Like Shawn Connelly likes this
Rick Bielawski Aug 01, 2018 • edited

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

Like # people like this
Robert Brauer Oct 17, 2018

I agree .... this is SOOOO needed!

Like # people like this
Greg Miller I'm New Here Jan 16, 2019

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

Like # people like this
Luke Johnson Jan 28, 2019

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

Like Angelo Antonino likes this
4 votes
Kathy Tempesta Feb 13, 2013

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

Steven Chavez May 29, 2018 • edited

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

<a href="https://www.yoursite.com" 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="https://www.yoursite.com" target="_blank">Your Site</a>. (This will open in a new tab)</p>
Pangianto Pang Aug 02, 2012

Hi Septa,

Thanks for your help.

The code works like magic :)

Atlassian Rox!

Pleasure to help :)

Chris Advena Aug 08, 2017

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="http://google.com" target="_blank"> or the Atlassian suggested variantion, <a href="http://google.com" _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.  

3 votes

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

Thanks.

Jennifer Lo Oct 28, 2012

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?

Kathy Tempesta Feb 13, 2013

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

Andrei [errno] Aug 01, 2013

you could create a user macro that you'd use instead of a regular link
https://confluence.atlassian.com/display/DOC/Writing+User+Macros

Thomas Nilsson May 29, 2018

This is not available for OnDemand

Rahav Dor May 29, 2018

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 # people like this
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.

Scott Beeson Jan 17, 2019

Which is a duplicate of https://jira.atlassian.com/browse/CONFSERVER-11194 which is marked as resolved "won't fix". 

Useless.

Like # people like this
3 votes

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...!

1 vote
Alex Hermon Jun 20, 2018 • edited

The confluence documentation explains this, though not perfectly clearly: 

https://confluence.atlassian.com/confkb/how-to-force-links-to-open-in-a-new-window-213518072.html?_ga=2.234004124.381903139.1529489557-971472658.1517416118

 

 -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:

<script>
jQuery(document).ready(function() {
    jQuery(".external-link").attr("target", "_blank");
});
</script>

 

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="https://www.google.com">Google</a>  

 

Rahav Dor Jun 21, 2018

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 August Mikus likes this
slmxyz Wednesday

Thanks @Alex this solved my problem!

Like Saumya Sunder likes this
1 vote

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

image.png

 

View mode

image.png

1 vote

Hi, 

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!

Nathalie.

Steven Chavez Aug 29, 2018

Hello Nathalie,

This article should help you out:

https://confluence.atlassian.com/doc/html-macro-38273085.html

David Skrostrup-Nielsen Aug 29, 2018 • edited

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.

0 votes
Jola Bolaji Mar 12, 2019

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

873 views 0 19
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you