CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Creating Wordpress Users (with passwords) from Civi Members
Pages: [1]

Author Topic: Creating Wordpress Users (with passwords) from Civi Members  (Read 642 times)

Ground Glass

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: N/A
  • CMS version: N/A
  • MySQL version: N/A
  • PHP version: N/A
Creating Wordpress Users (with passwords) from Civi Members
January 15, 2015, 04:17:46 pm
Similar problem to this post: http://forum.civicrm.org/index.php?topic=33194.0

Also, this is probably a good resource: http://ask.metafilter.com/218507/Can-I-create-Wordpress-users-from-existing-CiviCRM-contacts

I've got civicrm installed on our wordpress site with 1200+ members in the database. One of the main functionalities of the site is a members-only area that requires you be logged in as a wordpress user.

My hope is to create a Wordpress user for every existing Civi member in the database, but I can't quite figure out how to do this. I've got some ideas from the two links I posted above, but I wouldn't really know what to do.

(When launching the site, I thought the "Synchronize Users to Contacts" function would do the trick, but it turns out it does the opposite of what I need.. This is a pretty big mistake on my part, because the site is meant to be live and fully functional tomorrow, but if members can't access anything, the site is half useless. AH!)

Has anybody dealt with this type of thing and wouldn't mind giving me a hand?
« Last Edit: January 15, 2015, 04:21:01 pm by Ground Glass »

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Creating Wordpress Users (with passwords) from Civi Members
January 16, 2015, 08:49:03 am
Are you comfortable using the command line?  If so, you can probably solve this problem with wp-cli (http://wp-cli.org/).  I wrote the section of this wiki page that describes using this same technique with Drupal and drush (http://wiki.civicrm.org/confluence/display/CRMDOC/Creating+a+Drupal+user+for+every+CiviCRM+contact).

In short, you can run "wp user create", which can also specify role, password, etc.:
Code: [Select]
wp user create <user-login> <user-email> [--role=<role>] [--user_pass=<password>] [--user_registered=<yyyy-mm-dd>] [--display_name=<name>] [--first_name=<first_name>] [--last_name=<last_name>] [--send-email] [--porcelain]

So the trick is to export your list of users from CiviCRM and open it in Excel.  Then you create a formula which takes your users and generates the appropriate "wp user create" command to create that user.  Paste that formula down, then take that column and save it to a text file.  You now have a script that will create 1200 Wordpress users!  The technique is described in detail on the wiki page above.  Hope that helps!

Jon

The exact technique is laid out well
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Creating Wordpress Users (with passwords) from Civi Members

This forum was archived on 2017-11-26.