# Creating Discourse accounts during user import

**URL:** https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234
**Category:** WordPress
**Created:** [27 Junio, 2017 21:41 UTC](https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234 "2017-06-27T21:41:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![epiphron](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@epiphron](https://meta.discourse.org/u/epiphron)
#### Post date: [27 Junio, 2017 21:41 UTC](https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234/1 "2017-06-27T21:41:12Z")

</div>

Hi, all. I’ve just launched a new WordPress website using the excellent [WP Discourse](https://github.com/discourse/wp-discourse) plugin for SSO and discussion.

Everything is working smoothly, but I’ve had to import a lot of user accounts from the client’s previous website. These users haven’t all logged in to the new website yet, but the client has asked whether they can be added to the Discourse forum as users, before logging in for the first time and generating their account via the SSO process.

Is it possible to create these accounts on Discourse without having the users login to WordPress and go through the SSO process?

---

<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: [27 Junio, 2017 22:04 UTC](https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234/2 "2017-06-27T22:04:16Z")

</div>

Is the situation that the users exist on the current site, but have never logged into the WordPress site? If so, I’m not sure why you need to create Discourse accounts for them before they have logged in. If you enable the wp-discourse ‘Create Discourse User on Login’ setting, accounts will be created for them when they first login to your site.

~~If you really need to do it, you can create Discourse users from WordPress users through the API. Here’s an example of how to do it:~~  
~~[wp-discourse-wishlist-member/lib/discourse-wishlist-utilities.php at master · scossar/wp-discourse-wishlist-member · GitHub](https://github.com/scossar/wp-discourse-wishlist-member/blob/master/lib/discourse-wishlist-utilities.php#L164)~~

Edit: for sites using SSO, the best way to add users to Discourse before they login is to use the `sync_sso` route: [Sync DiscourseConnect user data with the sync\_sso route](https://meta.discourse.org/t/sync-sso-user-data-with-the-sync-sso-route/84398).

---

<div class="post-metadata">

### Author: ![epiphron](https://avatars.discourse-cdn.com/v4/letter/e/d78d45/32.png) [@epiphron](https://meta.discourse.org/u/epiphron)
#### Post date: [27 Junio, 2017 22:18 UTC](https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234/3 "2017-06-27T22:18:04Z")

</div>

Hi @simon, thanks for the speedy reply. It’s mainly for the forum digest emails that get sent out. My client wants the website users to receive these emails without first having to sign in and access the forum.

Thanks for the link to that function, I’ll give it a go.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 Junio, 2024 12:44 UTC](https://meta.discourse.org/t/creating-discourse-accounts-during-user-import/65234/4 "2024-06-08T12:44:36Z")

</div>

Este tema se cerró automáticamente después de 2537 días. Ya no se permiten nuevas respuestas.
