Open all external links in a new window/tab

We want our external links to open in a new window or tab.

This article explains how to do this, but it's only working for links in a page. It's not working for external links in our space shortcuts.

I've found that external links in a page have the class 'external-link' like the article suggests, but the links in the space shortcuts have the class 'external_link' with an underscore instead of a dash. Even if I replace the dash with an underscore the link in the space shortcuts is opened in the same window anyway.

Is there a way to make external links in the space shortcuts open in target _blank as well?

1 answer

The article points to that plugin as well but we would like to solve it without adding just another plugin. Is it not possible to do this with a simple piece of javascript?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

910 views 23 12
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