# Disable “?u=\<user\>” in shared links

**URL:** https://meta.discourse.org/t/disable-u-user-in-shared-links/25356
**Category:** Support
**Created:** [18 Fevereiro , 2015 13:25 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356 "2015-02-18T13:25:33Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![jooize](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jooize/32/537063_2.png) [@jooize](https://meta.discourse.org/u/jooize)
#### Post date: [18 Fevereiro , 2015 13:25 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/1 "2015-02-18T13:25:33Z")

</div>

When you copy a link via the Share button Discourse appends “?u=jooize” (in my case). I want to disable this, can I do that without modifying the source code?

---

<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: [18 Fevereiro , 2015 13:52 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/2 "2015-02-18T13:52:49Z")

</div>

What’s bothering you with that query string?

---

<div class="post-metadata">

### Author: ![jooize](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jooize/32/537063_2.png) [@jooize](https://meta.discourse.org/u/jooize)
#### Post date: [18 Fevereiro , 2015 16:08 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/3 "2015-02-18T16:08:35Z")

</div>

Our community is privacy conscious and when you might want to link something under a different identity you don’t want to accidentally include your username.

---

<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: [18 Fevereiro , 2015 17:42 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/4 "2015-02-18T17:42:37Z")

</div>

It would also make certain badges impossible to achieve, though. I understand the concern, I guess..

---

<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: [18 Fevereiro , 2015 23:32 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/5 "2015-02-18T23:32:38Z")

</div>

Which badges? The Shares? Well…if the community is private I kind of see Sharing a moot point. From my POV as a private-community owner, I honestly wouldn’t want sharing in the first place, except to allow users to link within the community itself for the purpose of writing replies.

Don’t know if it’s an option to turn all that off and disable/remove default badges like Shares.

---

<div class="post-metadata">

### Author: ![wesochuck](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/wesochuck/32/108706_2.png) [@wesochuck](https://meta.discourse.org/u/wesochuck)
#### Post date: [18 Fevereiro , 2015 23:40 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/6 "2015-02-18T23:40:58Z")

</div>

> [@purldator](#):
>
> Don’t know if it’s an option to turn all that off and disable/remove default badges like Shares.

Yes, this can be done in **/admin/badges**. Select the badge for example **Nice Share** then scroll down to the bottom and uncheck the the **Enable Badge** checkmark box.

![](https://global.discourse-cdn.com/meta/original/3X/0/4/04a37c56449c712d45742624214ed97d689416b5.png)

> [@purldator](#):
>
> I honestly wouldn’t want sharing in the first place

If you go under **/admin** and type **share** into the the filter box, then you’ll should be able to remove the share option from the post menu.

---

<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: [19 Fevereiro , 2015 00:47 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/7 "2015-02-19T00:47:04Z")

</div>

This is not configurable now, you would need a source level modification to disable it. Open to adding a site setting if you wish.

---

<div class="post-metadata">

### Author: ![jooize](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jooize/32/537063_2.png) [@jooize](https://meta.discourse.org/u/jooize)
#### Post date: [19 Fevereiro , 2015 09:42 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/8 "2015-02-19T09:42:09Z")

</div>

We would really appreciate that, @sam.

---

<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: [19 Fevereiro , 2015 13:00 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/9 "2015-02-19T13:00:06Z")

</div>

Sure, but someone is going to have to contribute this.

---

<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: [10 Setembro , 2018 10:21 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/10 "2018-09-10T10:21:52Z")

</div>



---

<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: [11 Setembro , 2018 00:14 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/11 "2018-09-11T00:14:36Z")

</div>

> [@jooize](#):
>
> I want to disable this, can I do that without modifying the source code?

This can now be done in a theme component, @Johani if you can swing this in 15 minutes can you demo how it would be done.

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [11 Setembro , 2018 07:21 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/12 "2018-09-11T07:21:10Z")

</div>

This should do it

```plaintext
<script type="text/discourse-plugin" version="0.8">
  const later = require("@ember/runloop").later;

  api.modifyClass("component:share-popup", {
    _focusUrl() {
      this._super(...arguments);

      // Needs later because of https://git.io/JfmTU
      later(() => {
        if (this.element) {
          const linkInput = this.element.querySelector("#share-link input");
          linkInput.value = this.link.split("?")[0];
        }
      }, 200);
    }
  });
</script>

```

---

<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: [11 Outubro , 2018 07:22 UTC](https://meta.discourse.org/t/disable-u-user-in-shared-links/25356/13 "2018-10-11T07:22:02Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
