# Could you update user avatar for wordpress plugin sso?

**URL:** https://meta.discourse.org/t/could-you-update-user-avatar-for-wordpress-plugin-sso/204517
**Category:** WordPress
**Created:** [September 27, 2021, 4:58am UTC](https://meta.discourse.org/t/could-you-update-user-avatar-for-wordpress-plugin-sso/204517 "2021-09-27T04:58:55Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![angus](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/angus/32/341715_2.png) [@angus](https://meta.discourse.org/u/angus)
#### Post date: [September 28, 2021, 3:51am UTC](https://meta.discourse.org/t/could-you-update-user-avatar-for-wordpress-plugin-sso/204517/2 "2021-09-28T03:51:07Z")

</div>

Hey @cmdntd 🙂

It sounds like you have Discourse setup as the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider for Wordpress via the [WP Discourse](https://github.com/discourse/wp-discourse) plugin? Is that right?

Wordpress doesn’t actually have custom user avatars out of the box. You need to use a Wordpress avatar plugin. This is partly why the [WP Discourse](https://github.com/discourse/wp-discourse) plugin doesn’t just have a setting to sync Discourse avatars when Discourse is the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider, as the way custom avatars are handled will depend on the way a Wordpress implements that kind of custom feature.

However, the [WP Discourse](https://github.com/discourse/wp-discourse) plugin gives you a filter you can use to access the Discourse avatar url: `wpdc_sso_client_updated_user`. This filter will be applied every time the user logs in to Wordpress using [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true).

```plaintext
add_filter( 'wpdc_sso_client_updated_user', 'my_wpdc_sso_client_updated_user', 10, 2 );
function my_wpdc_sso_client_updated_user( $updated_user, $query ) {
	## use $query['avatar_url']
}

```

So, if you use a Wordpress avatar plugin to allow users to set custom avatars in Worpress and this filter you can set Wordpress user’s avatars as their Discourse avatar when Discourse is the [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) Provider.

---

_[View the full topic](https://meta.discourse.org/t/could-you-update-user-avatar-for-wordpress-plugin-sso/204517)._
