# How to anonymize your links in Discourse?

**URL:** <https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185>\
**Category:** Support\
**Created:** [2015年二月12日 23:39 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185 "2015-02-12T23:39:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Huey\_Le](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/huey_le/32/63362_2.png) [@Huey\_Le](https://meta.discourse.org/u/Huey_Le)\
**Post date:** [2015年二月12日 23:39 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/1 "2015-02-12T23:39:25Z")

</div>

Hi guys, can anyone suggest some sort way or java script or plugins for discourse that will allow me to anonymize the url links?

---

<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:** [2015年二月12日 23:48 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/2 "2015-02-12T23:48:27Z")

</div>

What do you mean by “anonymize”?

---

<div class="post-metadata">

**Author:** ![Huey\_Le](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/huey_le/32/63362_2.png) [@Huey\_Le](https://meta.discourse.org/u/Huey_Le)\
**Post date:** [2015年二月13日 00:26 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/3 "2015-02-13T00:26:06Z")

</div>

something like this

> **[anonymously link to any website - anonym.to](https://anonym.to/en.html)**

---

<div class="post-metadata">

**Author:** ![thangngoc89](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thangngoc89/32/115436_2.png) [@thangngoc89](https://meta.discourse.org/u/thangngoc89)\
**Post date:** [2015年二月13日 06:30 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/4 "2015-02-13T06:30:59Z")

</div>

@Huey_Le you means all links will be redirected to an external domain ? As I see, there is a script in their home page. You can take a look at that

---

<div class="post-metadata">

**Author:** ![Huey\_Le](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/huey_le/32/63362_2.png) [@Huey\_Le](https://meta.discourse.org/u/Huey_Le)\
**Post date:** [2015年二月13日 20:19 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/5 "2015-02-13T20:19:09Z")

</div>

That’s exactly what I want. I’ve tried to copy the script and paste that into the Header ( Admin Panel, Customize → CSS —\> Header ), but it’s still not working

---

<div class="post-metadata">

**Author:** ![penne12](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/penne12/32/115638_2.png) [@penne12](https://meta.discourse.org/u/penne12)\
**Post date:** [2015年二月14日 01:47 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/6 "2015-02-14T01:47:42Z")

</div>

> [@Huey\_Le](#):
>
> [anonymously link to any website - anonym.to](http://anonym.to/en.html#anleitung)

Try pasting that into the footer, as it says on the site. Why do you need to “antonymize” them?

---

<div class="post-metadata">

**Author:** ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)\
**Post date:** [2015年二月14日 02:02 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/7 "2015-02-14T02:02:59Z")

</div>

The basic reason is perhaps his forum is talking about something or someone and links to what’s being talked about need to be antonymized so his forum and the discussions don’t show up in the target’s referrer backlogs and see what’s going on.

While this can be used for abusive means, I have used it to make sure my members can speak about other forums that _are abusive_ to fans and link to proof of that without the other forum knowing they are actually being talked about.

---

<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年二月14日 02:34 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/8 "2015-02-14T02:34:24Z")

</div>

Have you tried using [https://archive.today](https://archive.today)?

---

<div class="post-metadata">

**Author:** ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)\
**Post date:** [2015年二月14日 02:38 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/9 "2015-02-14T02:38:30Z")

</div>

Hmm, that would be very useful. I was also looking at [linkonym](http://www.linkonym.com/) too, mostly because it’s hosted by google (their app engine) so there’s little chance it will suddenly poof.

---

<div class="post-metadata">

**Author:** ![Huey\_Le](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/huey_le/32/63362_2.png) [@Huey\_Le](https://meta.discourse.org/u/Huey_Le)\
**Post date:** [2015年二月14日 05:13 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/10 "2015-02-14T05:13:46Z")

</div>

Have you successfully implemented this feature yet? Will you be able to share what plugins or method that you used?

---

<div class="post-metadata">

**Author:** ![19eighties](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/19eighties/32/37584_2.png) [@19eighties](https://meta.discourse.org/u/19eighties)\
**Post date:** [2015年二月14日 06:25 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/11 "2015-02-14T06:25:27Z")

</div>

linkonym’s current status.

[https://archive.today/KH1Ul](https://archive.today/KH1Ul)

---

<div class="post-metadata">

**Author:** ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)\
**Post date:** [2015年二月14日 11:19 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/12 "2015-02-14T11:19:53Z")

</div>

Hah! Figures. Thanks for the update.

> [@Huey\_Le](#):
>
> Have you successfully implemented this feature yet? Will you be able to share what plugins or method that you used?

Only idea I have so far is to make a custom button for the composer to add part of the anon-izer to the front of a user’s link. But seeing that linkonym is a bust effort I’ll possibly use archive.today and use their API (if it’s usable).

---

<div class="post-metadata">

**Author:** ![lidel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lidel/32/115991_2.png) [@lidel](https://meta.discourse.org/u/lidel)\
**Post date:** [2015年二月15日 22:00 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/13 "2015-02-15T22:00:02Z")

</div>

Another one is [http://nullrefer.com](http://nullrefer.com), which seems to be quite stable and is used by some “chans”.  
Usage:

```
  http://www.nullrefer.com/?http://www.google.com

```

I think the best approach here would be a server-side plugin (instead of JS executed in browser) that adds the service as a prefix to all external URLs inside of `.cooked` posts. That way web crawlers would not leak referrer information to linked sites.

---

<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年二月16日 21:21 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/14 "2015-02-16T21:21:59Z")

</div>

> [@lidel](#):
>
> That way web crawlers would do not leak referrer information to linked sites.

Note that all links by users below TL3 are `rel=nofollow`.

---

<div class="post-metadata">

**Author:** ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)\
**Post date:** [2016年七月1日 12:24 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/16 "2016-07-01T12:24:57Z")

</div>

Did anybody come up with a way of enabling a dereferrer for outgoing links?

I was considering a JavaScript solution, but this does collide with Discourse’s link counting (which redirects the user via `/click/track`, but doesn’t change the fact that the original post’s URL will appear in the `Referrer` header).

**Update** : As long as there is no setting or plug-in for this, the only way to solve this problem would be to add the following JavaScript:

```plaintext
jQuery(function() {
  $('body').on('mouseover', 'a', function(evt) {
    $(evt.target).attr('rel', 'noreferrer');
  });
});

```

---

<div class="post-metadata">

**Author:** ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)\
**Post date:** [2016年八月4日 22:35 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/17 "2016-08-04T22:35:15Z")

</div>

**Solution** : It’s best to customize your Discourse instance by adding the following snippet before `</head>` , which is at least supported by current versions of Chrome and Firefox (but not e.g. in IE 11).

```html
<meta name="referrer" content="never" />

```

The supported values and corresponding referrers being sent (taking this topic as an example) are:

- _unsafe-URL_ (default) = [How to anonymize your links in Discourse?](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185)
- **_never_ = (no referrer)**
- _origin_ = [https://meta.discourse.org/](https://meta.discourse.org/)
- _no-referrer-when-downgrade_ = [https://meta.discourse.org/](https://meta.discourse.org/) (but only if destination is a https:// site)
- _origin-when-crossorigin_ = [How to anonymize your links in Discourse?](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185) for destinations on [meta.discourse.org](http://meta.discourse.org) and [https://meta.discourse.org](https://meta.discourse.org) for other origins)  
(Source: [\<meta\> HTML metadata element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta))

---

<div class="post-metadata">

**Author:** ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)\
**Post date:** [2016年八月7日 16:41 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/18 "2016-08-07T16:41:40Z")

</div>

@codinghorror Any chance to make this a feature? Ideally, we would have

1. a global setting like “ Suppress referrer [for external links]” which would set the `<meta>` tag (or whatever is needed to suppress the referrer in the future).
2. (optional) a way to configure a dereferrer service (such as [dereferer.me](https://dereferer.me/)) using a URL with a placeholder (e.g. `https://dereferer.me/?%s`). (The trickiest part is probably not to interfere with the link click counting.)

---

<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:** [2016年八月7日 18:24 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/19 "2016-08-07T18:24:29Z")

</div>

> [@claas](#):
>
> global setting like “ Suppress referrer [for external links]” which would set the \<meta\> tag (or whatever is needed to achieve this in the future).

You can do this right now with Admin → Customize. Put the tag in the head section.

---

<div class="post-metadata">

**Author:** ![claas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/claas/32/71725_2.png) [@claas](https://meta.discourse.org/u/claas)\
**Post date:** [2016年八月7日 18:49 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/20 "2016-08-07T18:49:20Z")

</div>

> [@riking](#):
>
> You can do this right now with Admin -\> Customize. Put the tag in the head section.

Yes, but:

- This is a customization that is _only_ available to admins who know about this issue.
- This it _not_ a setting that is available (more precisely: discoverable) to all admins.

For corporate Discourse instances, this can be a delicate issue, because the referrer may disclose information about

- internal network structures (the instance might be accessible from outside, even if login restricted) and/or
- internal topics you discuss (like unpublished projects or strategies or competitors).

And for the record: It is currently not possible to configure a dereferrer service to be used by Discourse.

---

<div class="post-metadata">

**Author:** ![purldator](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@purldator](https://meta.discourse.org/u/purldator)\
**Post date:** [2016年八月7日 22:21 UTC](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185/21 "2016-08-07T22:21:01Z")

</div>

This information may be best suited for the default topic auto-posted with every installation, as it appears only a small demographic need to remove the referrer for all outgoing links.

RE, Corporations; Discourse itself may not offer/allow an easy installation for these kinds of referrer-removal services. But an _entire intranet_ _do_. These services are only proxies, and proxies come in various forms.

For example: in less than two minutes, [I googled a possible way to remove the referral header for all outbound links via Nginx](https://gist.github.com/sanmai/10341223).

[下一頁](https://meta.discourse.org/t/how-to-anonymize-your-links-in-discourse/25185.md?page=2)
