Skip to content

A function to import WordPress users with optional custom meta data and groups.

License

Notifications You must be signed in to change notification settings

JoelLisenby/wp_import_users

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wp_import_users

A simple function to import users from a CSV file into WordPress. Also has the ability to add the imported users to a group by group name. If applicable you can add as many custom meta data columns as you want by modifying the function.

CSV Format Requirements

Note: the function will ignore the first row so you can safely leave your column headings in the csv file.

Example CSV

  • Custom Meta Data Columns: phone, fax
  • Group Column: group
role,email,first_name,last_name,title,phone,fax,group
author,john.doe@gmail.com,John,Doe,Employee,5555555555,5555555555,ACME Employees

Import Custom User Meta Data

The function has the ability to add custom meta data to users ready to use by uncommenting the respective lines in the function.

Insert Users Into Groups

Group import is for itthinx Groups plugin. https://wordpress.org/plugins/groups/

Just uncomment the respective lines in the function to import the users into the group and list the group name in the CSV file.

Function usage

  1. Upload your properly formatted CSV file to your active theme directory.
  2. Add the function to your theme's functions.php file.
  3. Adjust the file name.
  4. Uncomment optional features (custom meta data, group insertion)
  5. Uncomment the function call at the bottom
  6. Load any page while logged in as super admin.

Once you are done, be sure to remove or recomment the function call as it will slow the site down while running and throw errors once the users have been imported.

About

A function to import WordPress users with optional custom meta data and groups.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages