# Behaviour of external links for not logged-in visitors

**URL:** <https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459>\
**Category:** Feature\
**Tags:** pr-welcome\
**Created:** [2014年四月4日 14:07 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459 "2014-04-04T14:07:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![arajvanshi](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@arajvanshi](https://meta.discourse.org/u/arajvanshi)\
**Post date:** [2014年四月4日 14:07 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/1 "2014-04-04T14:07:49Z")

</div>

I selected the setting default\_external\_links\_in\_new\_tab in the admin area. This resulted in the expected behaviour of setting default preference of all new users set to ‘open external links in new tab’.

However, for non-logged-in visitors, the behaviour is still the old one, it is opening the external links in the same tab leading visitors to go away from the website. When admin selects the default\_external\_links\_in\_new\_tab setting, it should change the behaviour for non-logged-in visitors as well.

---

<div class="post-metadata">

**Author:** ![arajvanshi](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@arajvanshi](https://meta.discourse.org/u/arajvanshi)\
**Post date:** [2014年四月18日 07:02 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/2 "2014-04-18T07:02:26Z")

</div>

Any update on this issue? Anything I can do to fix this locally?

---

<div class="post-metadata">

**Author:** ![mcwumbly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mcwumbly/32/103861_2.png) [@mcwumbly](https://meta.discourse.org/u/mcwumbly)\
**Post date:** [2014年四月18日 14:12 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/3 "2014-04-18T14:12:13Z")

</div>

The default\_external\_links\_in\_new\_tab setting was added relatively recently. Before that, only end users could change this via their user preferences.

I am guessing the issue is that when that setting was added, it was implemented such that when a new user is created, their initial preference is set.

But the logic still holds that the setting is only effective for the current user via their preferences.

This may or may not have been a conscious decision, so I think you should recategorize this topic as a “feature” request.

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2014年四月18日 14:17 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/4 "2014-04-18T14:17:18Z")

</div>

I knocked together a quick PR:

[https://github.com/discourse/discourse/pull/2278](https://github.com/discourse/discourse/pull/2278)

> [@mcwumbly](#):
>
> This may or may not have been a conscious decision

The ‘false’ behavior was from acting on an undefined value returned from `Discourse.User.currentProp()` when there is no current user, so it seemed to me to not be intentional one way or the other.

---

<div class="post-metadata">

**Author:** ![Barnabas20](https://avatars.discourse-cdn.com/v4/letter/b/e95f7d/32.png) [@Barnabas20](https://meta.discourse.org/u/Barnabas20)\
**Post date:** [2014年八月18日 01:00 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/5 "2014-08-18T01:00:07Z")

</div>

Non logged in users still not able open external links on new tab.

---

<div class="post-metadata">

**Author:** ![yagizozturk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yagizozturk/32/115368_2.png) [@yagizozturk](https://meta.discourse.org/u/yagizozturk)\
**Post date:** [2015年一月2日 20:01 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/6 "2015-01-02T20:01:36Z")

</div>

Is there any update plan on that?

---

<div class="post-metadata">

**Author:** ![Prem\_Anand](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/prem_anand/32/116357_2.png) [@Prem\_Anand](https://meta.discourse.org/u/Prem_Anand)\
**Post date:** [2015年七月3日 14:22 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/7 "2015-07-03T14:22:49Z")

</div>

Is this feature available yet?

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2015年七月6日 15:43 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/8 "2015-07-06T15:43:22Z")

</div>

@riking what is going on here?

---

<div class="post-metadata">

**Author:** ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)\
**Post date:** [2015年七月6日 17:42 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/9 "2015-07-06T17:42:42Z")

</div>

We still have the problem behavior mentioned in the OP.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2017年五月16日 15:22 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/11 "2017-05-16T15:22:15Z")

</div>

#pr-welcome here, I do not think this is bug proper, rather expanded functionality for anon.

---

<div class="post-metadata">

**Author:** ![MarcP](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/marcp/32/160184_2.png) [@MarcP](https://meta.discourse.org/u/MarcP)\
**Post date:** [2021年七月1日 15:46 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/12 "2021-07-01T15:46:20Z")

</div>

我认为让匿名用户/访客在新标签页中打开外部链接会很有用……否则他们可能会因为点击主题中的链接而离开，导致这里的流量流失。

---

<div class="post-metadata">

**Author:** ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)\
**Post date:** [2025年十二月4日 11:10 UTC](https://meta.discourse.org/t/behaviour-of-external-links-for-not-logged-in-visitors/14459/13 "2025-12-04T11:10:02Z")

</div>


