# External Links not opening in new tab

**URL:** <https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092>\
**Category:** Support\
**Created:** [2016年九月13日 16:53 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092 "2016-09-13T16:53:19Z")\
**Posts on this page:** 15\
**Page:** 2

<div class="post-metadata">

**Author:** ![Francois\_Douville](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/francois_douville/32/94221_2.png) [@Francois\_Douville](https://meta.discourse.org/u/Francois_Douville)\
**Post date:** [2018年四月26日 17:55 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/21 "2018-04-26T17:55:33Z")

</div>

Yes I did. For members, it works but not for non-members…

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2018年四月26日 17:56 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/22 "2018-04-26T17:56:01Z")

</div>

Right, it doesn’t work for non-members because non-members do not have settings.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2018年四月26日 17:56 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/23 "2018-04-26T17:56:17Z")

</div>

Oh. Sorry. I guess that’s right for the reasons that I (and now @cpradio) explained.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2018年五月11日 19:15 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/24 "2018-05-11T19:15:06Z")

</div>

Could the not-logged-in setting be changed with CSS?

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2018年五月11日 22:06 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/25 "2018-05-11T22:06:15Z")

</div>

Not with CSS. You’d likely have to write a plugin that overrides the default setting. I thought that was discussed here somewhere, but I couldn’t find it.

---

<div class="post-metadata">

**Author:** ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)\
**Post date:** [2019年四月11日 02:01 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/26 "2019-04-11T02:01:59Z")

</div>

If you want both users _and_ guests to always open links in a new tab, you have to completely override `trackClick` in `discourse/lib/click-track` in an intializer (in a plugin). Specifically this: [https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/click-track.js.es6#L137](https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/lib/click-track.js.es6#L137). I wouldn’t advise it.

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月27日 01:53 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/27 "2019-04-27T01:53:17Z")

</div>

> [@fellowshipforums](#):
>
> m also having an issue here. I have a hyperlink in my category description, and I would like to it open in the new tab. I have checked the box in my user settings to open external links in a new tab, but its not working when the link is in a description. Is t

Agree. But some-time ethics have to take back seat in the world, when small inconvenience of our users might bring some unexpected positive results for us.

Push Notifs also fall into the same category. Not all users want all push notifs. But still websites configure them (facebook is particularly notorious) to bombard some non-useful notif than to miss some legit one.

Note: Even though I’ve configured external links to open in new tab, as here:

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/b/3b5f3941657c8d55f2f3a5d378a361a04beac827.png)  
But they are opening in the same tab, even for me, admin.  
What should I check?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2019年四月27日 03:23 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/28 "2019-04-27T03:23:06Z")

</div>

This are defaults for new users. You should check your profile settings.

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月27日 04:23 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/29 "2019-04-27T04:23:23Z")

</div>

> [@pfaffman](#):
>
> This are defaults for new users. You should check your profile settings

I’m not talking about the implementation of this feature (i.e. links opening into new tabs).

I’m talking as to how can I set my disco site so as to whenever any user on my forums clicks an external link, the link should open in a new tab. And I don’t expect users to go into their preferences first and change this option.  
I myself can change that option before hand, if that’s possible.

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2019年四月27日 04:28 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/30 "2019-04-27T04:28:50Z")

</div>

The site settings that you show above set the setting for **new** users. To see how it works, create a new account.

Having links open in a new tab is an accessibility problem. If you can’t see, it’s confusing to click a link and not be able to tell what happened. That’s why the default is off.

If you want to change the setting for existing users you can search here for a rails command that will change the value for all existing users.

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月27日 07:32 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/31 "2019-04-27T07:32:50Z")

</div>

That settles it for me.

---

<div class="post-metadata">

**Author:** ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)\
**Post date:** [2019年四月29日 08:38 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/32 "2019-04-29T08:38:14Z")

</div>

> [@BobbyZopfan](#):
>
> I’m talking as to how can I set my disco site

 ![](https://global.discourse-cdn.com/meta/original/3X/1/8/18568b91b9f52bf25200748ce82bd3f81a9bac71.gif)

_(Not) sorry, I couldn’t resist._

---

<div class="post-metadata">

**Author:** ![BobbyZopfan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bobbyzopfan/32/149374_2.png) [@BobbyZopfan](https://meta.discourse.org/u/BobbyZopfan)\
**Post date:** [2019年四月29日 09:02 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/33 "2019-04-29T09:02:48Z")

</div>

If there is a disco bot.  
Then there is possibility of a disco site.

😜

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2022年八月11日 21:32 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/34 "2022-08-11T21:32:32Z")

</div>



---

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [2023年一月18日 11:22 UTC](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092/35 "2023-01-18T11:22:26Z")

</div>



[上一頁](https://meta.discourse.org/t/external-links-not-opening-in-new-tab/50092.md?page=1)
