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

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?

16 answers

1 accepted

41 votes
Answer accepted

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.

Like # people like this

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

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

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

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

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

Like # people like 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 Shawn Connelly 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 # people like this

Agreed! Good luck

Like Shawn Connelly likes this

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

Like # people like this

I agree .... this is SOOOO needed!

Like # people like this

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

Like # people like this

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

Like # people like this

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

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="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
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 https://jira.atlassian.com/browse/CONFSERVER-11194 which is marked as resolved "won't fix". 

Useless.

Like # people like this

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

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

Thanks.

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
https://confluence.atlassian.com/display/DOC/Writing+User+Macros

This is not available for OnDemand

Thank you for your answer @Andrei Ionescu 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

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>  

 

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

Thanks @Alex this solved my problem!

Like Saumya Sunder[Appfire] likes this
timregen I'm New Here Tuesday

Works for me from API with html storage macro too

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

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

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.

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.

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?

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

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.

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

0 votes

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) 

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

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

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 ?

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
Nicketa I'm New Here Aug 08, 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...

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

Introducing Confluence Cloud and Jira Software Cloud Premium

Wherever you are in your team’s journey , our goal is to support your big ambitions. We’re a cloud-first company with the mission of unleashing the potential of every team, and to address the range ...

689 views 5 18
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