Confluence hyperlink which open a new tab or a new window

Pangianto Pang August 2, 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?

19 answers

1 accepted

52 votes
Answer accepted
Steve Chavez August 1, 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 August 4, 2013

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

Like # people like this
Adam Saunders August 7, 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 rvlak likes this
Joe Porkka March 19, 2019

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

Like # people like this
Carla Ann Rowland
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 5, 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

Jurgen Barbieur March 25, 2022

this option doens't exist anymore?

is there another way to create links that opens in a new tab?

Like Praveen Gowda likes this
52 votes
Deleted user February 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?

roam_scott
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 27, 2018

It's asinine, really.

Like # people like this
Julian Fainlight June 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 June 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 June 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 June 20, 2018

Agreed! Good luck

Like Shawn Connelly likes this
Rick Bielawski August 1, 2018

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

Like # people like this
Robert Brauer October 17, 2018

I agree .... this is SOOOO needed!

Like # people like this
Greg_Miller January 16, 2019

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

Like # people like this
Luke Johnson January 28, 2019

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

Like # people like this
Achim Haag May 31, 2019

It's a shame that such a pricey product hasn't such a simple feature.
Buying Iframes for Confluence adds even more costs.

Btw: why is it possible in this forum to insert my link above with "open in new page" ?
Surely another macro for money...

Like # people like this
StepanStulovGoodlyInnovations August 28, 2019

It is a single middle mouse (wheel) click. Ok, on laptops its ctrl/cmd + tap. How much shorter can it be...

Like Rob Yaggie likes this
mike_daigle October 23, 2019

Single click is shorter.  The issue is when a link is in a field description.  If a user hits that link while creating a ticket, all info in the ticket is lost.

If multiple people want a feature, there's usually a reason why.

Like # people like this
7 votes
AnnWorley
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 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
Jessica Cohen March 13, 2020

100% useless

Like # people like this
5 votes
Rob Coops January 22, 2020

7 years after the original request, so many people asked for the same. Many years since Atlasian removed the ability to have links open in new pages (which was a thing back in the day) and still its not possible.

 

Is this just Atlasian hating their customers so much or is this them showing everyone that they know better...

Come on Atlasian show your paying customers some love and stop removing common functionality from your tools and making your users lives worse rather than better. Just add that tickbox back in and allow people to build pages that provide the user experience that they want/need to offer to their readers.

Mark Burgess December 3, 2021

Agreed.... this is such a fundamental User Experience need.... make it possible!

4 votes
Alex Hermon June 20, 2018

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>  

 

Deleted user June 21, 2018

Thank you @Artemis Support, 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 # people like this
SLM May 15, 2019

Thanks @nurac this solved my problem!

Like Saumya Sunder[Appfire] likes this
Tim Regen August 20, 2019

Works for me from API with html storage macro too

RWilburn March 5, 2021

Thank you! This worked perfectly for me. It was exactly what I needed!

4 votes
Kathy Tempesta February 13, 2013

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

MuniciPAY LLC May 29, 2018

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>
4 votes
Septa Cahyadiputra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2012
Pangianto Pang August 2, 2012

Hi Septa,

Thanks for your help.

The code works like magic :)

Atlassian Rox!

Like Dave likes this
Septa Cahyadiputra
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 2, 2012

Pleasure to help :)

Like Dave likes this
Chris Advena August 8, 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
Nathalie van der Linden August 30, 2018

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

Jim Ryan January 6, 2020

Comon Nathalie, If you don't pay for the basic functionality that should already exist in this POS product then the big guy couldn't afford this:

https://money.cnn.com/2018/09/27/luxury/mike-cannon-brookes-house/index.html

 

Oh, don't be afraid to click on the link 'cause it opens up in a new tab.  Guess they could get this forum to work that way... ;+}

 

-Jim

Like # people like this
Nathalie van der Linden January 15, 2020

Haha, true ;-) 

3 votes
Jose Alberto Hernandis October 2, 2012

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

Thanks.

Jennifer Lo October 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 February 13, 2013

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

Andrei [errno]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 1, 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

Deleted user 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
2 votes
Julian Fainlight February 7, 2020

Every so often I come back read this thread to hear what new arguments are posed for the feature or not.

I'm beginning to think that I don't want Atlassian to do the right thing and implement it, because then this thread would wither and die and I'd lose the entertainment.

What a sad state of affairs.

2 votes
David Skrostrup-Nielsen July 18, 2018

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
Nathalie van der Linden August 29, 2018

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 August 29, 2018

Hello Nathalie,

This article should help you out:

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

David Skrostrup-Nielsen August 29, 2018

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
StepanStulovGoodlyInnovations August 28, 2019

That would be a god awful feature. Choice between same tab, new tab or new windows must belong to the page viewer, not the page creator. Wait, must is not a strong enough word.

Steven Chavez August 28, 2019

@StepanStulovGoodlyInnovations ... there are many perspectives and uses around websites, and depending on how the site is used, your statement could be accurate. But it hardly dictates a standard for all cases.

Relating to your question above...

It is a single middle mouse (wheel) click. Ok, on laptops its ctrl/cmd + tap. How much shorter can it be and why on earth does the page creator decides this for the page viewer?

Not everyone is technical-minded enough on each shortcut provided from the device you're using. Example... you defined ways to open the content outside of the page if you're using a mouse or laptop. There are quite a few more. So for those that like your suggestion, but don't know each way to do it, it would help if you provided a reference for them to go and look those up. But then you face those who are not interested in learning each shortcut each OS provides via the attached hardware.

The issue presented was that the OP wants to open a page without taking over the page that the end-user is on when they click the link, a very normal property defined for hyperlinks and also defined in HTML standards.

An example I'd use in my case:

  • End-user is using my site as a knowledge base (I'm running Confluence).
  • I explain how to do something on the page and provide a reference link to another site to further describe the details.
  • I want that link to open in another tab or window... not because I don't care what the end-user wants to do... but because I don't want them to lose their place or get lost following links.

Another case would be a big outlet. You're on their site browsing things to buy. As a courtesy, they provide the products website in the details. If you click that link, it will often open a new tab or window. This is a marketing strategy used to retain the end-user, which assists with your profitability in the long run because the users aren't dropping off randomly due to distractions and getting lost in other sites and products.

You could say that, "Well... they have a Back button and a hotkey for that Back button", but an end-user doesn't always want to ditch the new page, so now you've forced them to make a choice between going back or continuing on, with the over-complicated option of copying the link before going back if they want both the original page and new.

It is the website/application's creator who best decides what the default options are for their hyperlinks, not the end-users... and there are specific reasons behind those choices, which does often include what works best for the end-user, but more-so takes into account the purpose and content of the site itself.

Like Scott Beeson likes this
Tim Regen August 28, 2019

As a confluence page author, I'd like to keep the reader on my page or in confluence, since it is the center of the context.   For external links, I like them to open in new tabs to retain the reader's context (rather than using the back button to reconnect readers to the context).  

As an HTML developer, I use the target attribute this way too, when applicable.   

I have seen developers overuse it and, yes, that can become an awful reader experience.   

Like # people like this
StepanStulovGoodlyInnovations August 29, 2019

Thank you guys, these are very thoughtful and considerate explanations.

You're explaining how you implement your strategy for the user. I don't argue the how. Your how is very thoughtful, well reasoned and well versed. The examples are also brilliant. I admire that way of thinking.

What I say is, you don't even get to decide. The decision dos not belong to you, despite there being a technical possibility for that, and despite you wanting to hand-hold the presumably not so sophisticated user. So, how is irrelevant, there is no how.

But it hardly dictates a standard for all cases.

Oh so unfortunately it doesn't, and that's why we have a circus with scary clowns as websites, each about to jump at you from a dark corner with their own "better" idea how to control your browser. I truly and wholeheartedly believe HTML target attribute should not exist.

You could say that, "Well... they have a Back button and a hotkey for that Back button", but an end-user doesn't always want to ditch the new page, so now you've forced them to make a choice between going back or continuing on, with the over-complicated option of copying the link before going back if they want both the original page and new.

If they want it, they do it, not you.

It is the website/application's creator who best decides what the default options are for their hyperlinks, not the end-users... and there are specific reasons behind those choices, which does often include what works best for the end-user, but more-so takes into account the purpose and content of the site itself.

No, not the creator, the end-user.

I propose we leave it at that, none of the sides makes an impression of being ready to change their mind :)

Deleted user August 29, 2019

Thanks, @StepanStulovGoodlyInnovations , for coming and sharing your thoughts.  Unfortunately, this thread is about another user asking how to incorporate this function, not soliciting advice on whether he/she should or should not utilize this function.  Your justification of why someone should not do this, plus your explanation of the difference between how and why, are essentially unhelpful and a waste of everyone's time.

Like # people like this
Scott Beeson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2019

> not the creator, the end-user

"Cars shouldn't have automatic transmissions because the END USER should get to decide how he drives and when to shift!  Not the creator!"

"Guns shouldn't have a safety because the end user should get to decide!"

"Houses shouldn't have walls because the end user should get to decide where he wants to go, not the architect!"

¯\_(ツ)_/¯

Like Steven Chavez likes this
StepanStulovGoodlyInnovations August 29, 2019

Witty.

"Cars should have seats pre-adjusted to the massive car designer and not move, because it was comfortable for him".

"Radios should have fixed volume cranked up, because their creator likes death metal loud."

¯\_(ツ)_/¯

You get the point. Anyway, I fail to see what cars, guns and walls have to do with hyperlinks. Surely the world has a million things where it's best to leave it to the service giver (surgery) and another million to the service receiver (car seat adjustments). So what? I was only talking about hyperlinks.

StepanStulovGoodlyInnovations August 29, 2019

@[deleted] are you everyone?

StepanStulovGoodlyInnovations August 29, 2019

I propose we leave it at that, none of the sides makes an impression of being ready to change their mind :)

0 votes
Nicketa August 8, 2019
Achim Haag August 21, 2019

Last week, I installed Link Opener for Confluence by EliteSoft, it's free.

The only drawback against an atlassian macro solution is: it works on a global base, not as a macro per link, meaning:

It adds two settings in the users profile
"open internal link in new tab(window)" and
"open external link in new tab(window)", the second activated by default.

So every user selects his preference.

Nevertheless: the best choice in my opinion would be a selection in the confluence link creation to open it in a new tab or new windows, that should be easily implementable...

Andrius Meldaikis August 22, 2019

This sounds like more less acceptable solution, too bad it's for server based Confluence only :( 

Scott Beeson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 9, 2021

Imagine paying $50 a month to allow users to open a link in a new tab by default...

Like Nicketa likes this
0 votes
Julian Fainlight July 5, 2019

It does seem stupid that this apparently simple request gets huge discussion and multiple rejections from Atlassian. If they implemented this they would get huge good will for minimal effort.

Ah well, nice to see them listen to users (not).

0 votes
Dr. HT July 4, 2019

It's kinda stupid we can't create a simple link pointing to a new page, and having to deal with macros for something so basic as this.

They talk about security in Cloud, but ... really ? Opening a link in a new page is a security risk ?

0 votes
Innes Phillips June 18, 2019

So this is an old article - but wanted to drop that you can get this behavior by using the "Button Hyperlink" macro which has an option to allow the hyperlink to be opened in another tab ( and a few other options) 

Achim Haag June 19, 2019

I found "Button Hyperlink" a part of Adaptavists "Content Formatting Macros for Confluence" (400$ for 250 User) :-(

Innes Phillips June 19, 2019

ah sorry - I did not realise that it was a paid macro!

0 votes
Julian Fainlight May 30, 2019

This fits in with their new transparent process for customer suggestions? I think not.

Maybe their 'many hours of discussion' could have been spent knocking this little item out?

Ah well, onward. Let's see what else can take 7 yeas to get denied.

Deleted user May 30, 2019

Naw, knocking out this feature would have taken only half that long!

0 votes
Jola Bolaji March 12, 2019
Deleted user May 30, 2019

Wow.  [Head shaking.]  Just wow.  "Inconsistent experience for users."  So they want it to be bad for everyone rather than some people have it good?

Achim Haag July 4, 2019

Attlasian recommends two plugins as a replacement.

One is free, so there's some risk that it will not be supported in a future Confluence version. If this happens, we have to change every occurence of the macro back to a standard link.

The other one is payware that does much more than just open a link in a new tab/window - so we have to pay for just a very basic function.

Very disappointing...

Like Christal Vandecar likes this
Spotify Club
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 13, 2024

Sometimes, I also faces the same problem with my working environment . But you have to bear it with your work. I have seen many blogs provide the tips to handle these issues . You can read their to get the solution.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events