# How to open hyperlinks in a new tab

**URL:** https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328
**Category:** Support
**Created:** [6월 12, 2017, 1:10오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328 "2017-06-12T01:10:21Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [6월 12, 2017, 1:10오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/1 "2017-06-12T01:10:21Z")

</div>

This thread spoke about directly links embedded:

> [@Open links in new tab not working](https://meta.discourse.org/t/open-links-in-new-tab-not-working/25620):
>
> Hi, I have selected ‘open external links in a new tab’ in preferences but it does not work. When a link is embedded in a comment and I click on it, the link is loaded within the iframe - it does not open a new tab. All of the anchor tags have target="\_blank" - but still they do not open in a new tab. Can you help? Thanks

I’m referring to links using hyperlink button:

> `[Google Test](http://www.google.com)`

[Google Test](http://www.google.com)

How do I get this to open in a new tab?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [6월 12, 2017, 2:22오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/2 "2017-06-12T02:22:55Z")

</div>

Change your user preference for this and reload the page, then click on it?

---

<div class="post-metadata">

### Author: ![RBoy](https://avatars.discourse-cdn.com/v4/letter/r/2bfe46/32.png) [@RBoy](https://meta.discourse.org/u/RBoy)
#### Post date: [6월 12, 2017, 2:26오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/3 "2017-06-12T02:26:58Z")

</div>

Yep that works at the individual user, would that setting also work through the Admin interface for all users (`default other external links in new tab`) or would each user go and set that setting?

Hmm I think I see what happened, since I already had an account, changing the setting through the Admin interface didn’t make a difference. So I’m assuming that when a new user signs up s/he will automatically have that setting enabled, but changing this admin setting doesn’t reset existing users settings. Am I correct?

---

<div class="post-metadata">

### Author: ![elijah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elijah/32/104055_2.png) [@elijah](https://meta.discourse.org/u/elijah)
#### Post date: [6월 12, 2017, 3:08오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/4 "2017-06-12T03:08:40Z")

</div>

Yes, site default settings get applied at account creation time. Get your important ones set up **early**.

---

<div class="post-metadata">

### Author: ![hutchinsfairy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hutchinsfairy/32/103475_2.png) [@hutchinsfairy](https://meta.discourse.org/u/hutchinsfairy)
#### Post date: [6월 12, 2017, 9:14오전 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/5 "2017-06-12T09:14:20Z")

</div>

If you already have a tonne of users to update and have console access then you can run an SQL update against the database as below. Please create and download a backup first.

```
cd /var/discourse/
./launcher enter app
su discourse
psql
UPDATE USER_OPTIONS 
SET EXTERNAL_LINKS_IN_NEW_TAB = 't'
WHERE USER_ID <> -1 
AND EXTERNAL_LINKS_IN_NEW_TAB = 'f';
\q
exit
exit

```

Also be aware that this will affect users who may have actually chosen not to use external links. If you wanted to see who it would affect before running it then I would install the [Data Explorer plugin](https://meta.discourse.org/t/data-explorer-plugin/32566) and use the following query:

```
SELECT u.ID "User ID" 
       ,u.USERNAME "Username" 
       ,u.NAME "Name" 
       ,CASE uo.EXTERNAL_LINKS_IN_NEW_TAB 
          WHEN 't' THEN 'True' 
          WHEN 'f' THEN 'False' 
          ELSE 'Not set' 
        END "External links?"
FROM USERS u 
       LEFT OUTER JOIN USER_OPTIONS uo 
                    ON u.ID = uo.USER_ID 
WHERE uo.EXTERNAL_LINKS_IN_NEW_TAB = 'f' 
   AND u.ID <> -1

```

---

<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: [2월 21, 2018, 10:01오후 UTC](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328/6 "2018-02-21T22:01:10Z")

</div>


