# 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:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![lukemccallum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lukemccallum/32/163826_2.png) [@lukemccallum](https://meta.discourse.org/u/lukemccallum)
#### Post date: [December 13, 2019, 12:21am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/1 "2019-12-13T00:21:47Z")

</div>

Hey all,

Maybe I am missing something, but how do I achieve the following?

Existing Wordpress site containing hundreds of registered members.  
New Discourse self hosted installation using Wordpress as SSO provider.

I need to import all of the existing Wordpress Users into Discourse so that they don’t need to first login to the Wordpress site in order to gain access to the Discourse notifications.

These users are NOT tech savvy and asking them to first login to the website is just too complex for them.

They are currently used to using a Google Groups noticeboard system that they can communicate with posts purely via email. Thus they will not reliably self provision within the new hosted Discourse.

Any ideas would be greatly appreciated.

---

<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:35am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/2 "2019-12-13T00:35:24Z")

</div>

Are you trying to migrate users to Discourse or to Discord?

If you are using WordPress as the SSO provider for Discourse with the [WP Discourse](https://github.com/discourse/wp-discourse) plugin, enabling the Create or Sync Discourse Users on Login option should accomplish what you are looking for. Discourse users will be created from WordPress users when they first login to your WordPress site.

---

<div class="post-metadata">

### Author: ![lukemccallum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lukemccallum/32/163826_2.png) [@lukemccallum](https://meta.discourse.org/u/lukemccallum)
#### Post date: [December 13, 2019, 12:42am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/3 "2019-12-13T00:42:19Z")

</div>

@simon Discourse sorry.

I have that option enabled, but I don’t want the users to HAVE to login in order to be created in Discourse.  
Due to the users technical ineptitude, I need to mass import them into Discourse without any interaction from them.

The VAST majority of the users will never actually login. However they WILL participate in conversations via email replies.

---

<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.

---

<div class="post-metadata">

### Author: ![lukemccallum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lukemccallum/32/163826_2.png) [@lukemccallum](https://meta.discourse.org/u/lukemccallum)
#### Post date: [December 13, 2019, 1:00am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/5 "2019-12-13T01:00:10Z")

</div>

Awesome thanks. And if I am not confident with a bit of programming?

---

<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, 1:32am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/6 "2019-12-13T01:32:41Z")

</div>

What I posted above might be the easiest way to get your existing users into WordPress. If you have a budget, you could create a topic in our #Marketplace category to find someone to do the work for you.

If you don’t have a budget, you could plead with your users to login to your WordPress site. If you have a lot of users who are never going to login to WordPress or Discourse, you might need to re-think your approach.

---

<div class="post-metadata">

### Author: ![lukemccallum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lukemccallum/32/163826_2.png) [@lukemccallum](https://meta.discourse.org/u/lukemccallum)
#### Post date: [December 13, 2019, 1:49am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/7 "2019-12-13T01:49:07Z")

</div>

Thanks @simon.  
I have posted in the #Marketplace.

Thanks for your assistance.

---

<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, 2:06am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/8 "2019-12-13T02:06:29Z")

</div>

Depending on your situation, the easiest thing to do would be to not use SSO to log users into Discourse. Then you could just export a list of users from WordPress, extract their email addresses into a CSV file, and use the Discourse [bulk invite functionality](https://meta.discourse.org/t/sending-bulk-user-invites/16468) to invite them to your forum. You could customize the invite email to let users know that they need to click the link in the email and agree to join the community. Once they’ve done that, they are free to interact with it by email.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 13, 2019, 12:25pm UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/9 "2019-12-13T12:25:45Z")

</div>

Sounds like what you should do is do an import of the existing data. Can you get mbox files of the list?

---

<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: [September 29, 2023, 7:20am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/10 "2023-09-29T07:20:32Z")

</div>



---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [September 29, 2023, 8:44am UTC](https://meta.discourse.org/t/import-existing-wordpress-users-into-discourse/135823/11 "2023-09-29T08:44:46Z")

</div>


