# Import Existing Wordpress Users into Discourse

**URL:** <https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823>\
**Category:** Support\
**Created:** [December 13, 2019, 12:21am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823 "2019-12-13T00:21:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [December 13, 2019, 12:56am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/4 "2019-12-13T00:56:22Z")

</div>

There are a few ways you could approach it. If you are ok with doing some programming, there are some static functions that the [WP Discourse](https://github.com/discourse/wp-discourse) plugin makes available for sites that are using WordPress as the SSO provider for Discourse. The functions are in this file: [https://github.com/discourse/wp-discourse/blob/master/lib/utilities.php](https://github.com/discourse/wp-discourse/blob/master/lib/utilities.php).

To use them, you would need to loop through all your WordPress users and for each user call:

```php
$sso_params = \WPDiscourse\Utilities\Utilities::get_sso_params( $user );

\WPDiscourse\Utilities\Utilities::sync_sso_record( $sso_params );

```

The `$user` parameter in the first line should be a WordPress user object.

You will need to be aware of Discourse rate limiting. You’ll want to limit your requests to about one request per second. When the call to `sync_sso_record` is successful, a Discourse user will be returned.

---

_[View the full topic](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823)._
