# "Discourse Username" in WP - what does it do?

**URL:** https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006
**Category:** WordPress
**Created:** [2017年五月2日 22:28 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006 "2017-05-02T22:28:57Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [2017年五月2日 22:28 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006/1 "2017-05-02T22:28:57Z")

</div>

What is the purpose of the “Discourse Username” field which is editable in the user’s profile in WP?

I sign up as a test user in WP and all is well - user is automatically created in Discourse with the same user name as in WP. Discourse Username in WP is blank at this point. Then I changed the Discourse Username in WP, logged out and logged in again - no changes.

This is all fine, but will probably confuse some users, so is it OK to hide that field in WP from the user? And, what is the best way to hide it?

Thanks.

---

<div class="post-metadata">

### Author: ![Grex315](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/grex315/32/115868_2.png) [@Grex315](https://meta.discourse.org/u/Grex315)
#### Post date: [2017年五月2日 22:52 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006/2 "2017-05-02T22:52:24Z")

</div>

If you allow users to publish posts from WP into Discourse this will assign the post in Discourse to the user specified in that field. Otherwise it will use the default from the plugin settings. You have to enter this field manually. If you are using sso this should match the wp username.

---

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [2017年五月2日 22:59 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006/3 "2017-05-02T22:59:04Z")

</div>

Thanks, @Grex315. Only an admin can publish posts in my setup, so I will ignore it for regular users.

Is there a better way to hide if than via CSS?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2017年五月2日 23:00 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006/4 "2017-05-02T23:00:43Z")

</div>

> [@omarfilip](#):
>
> Is there a better way to hide if than via CSS?

Yes, you can add something like this to your theme’s `functions.php` file:

```plaintext
add_filter( 'user_contactmethods', 'my_namespace_remove_discourse_user' );
function my_namespace_remove_discourse_user( $contact_methods ) {
    unset( $contact_methods['discourse_username'] );

    return $contact_methods;
}

```

---

<div class="post-metadata">

### Author: ![omarfilip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/omarfilip/32/208019_2.png) [@omarfilip](https://meta.discourse.org/u/omarfilip)
#### Post date: [2017年五月2日 23:04 UTC](https://meta.discourse.org/t/discourse-username-in-wp-what-does-it-do/62006/5 "2017-05-02T23:04:26Z")

</div>

Excellent! Thanks very much @simon.
