# 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:** 1
**Showing post:** 5

<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

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-open-hyperlinks-in-a-new-tab/64328)._
