Back to blog
5 min read Export Guides

Migrate WordPress Users with Their Passwords to a New Site

When you move a community, a membership site or a shop’s customers to a new WordPress site, the hardest part is passwords. WordPress never stores them in readable form, only as hashes, and most user exports leave the hashes out, so every user has to reset the password after the move. If you carry the hashes over, users log in on the new site with the passwords they already have. Import Export by RockStarLab PRO imports a password hash as it is, without hashing it a second time.

PRO: user import is part of the PRO plugin. The test below used Import Export by RockStarLab PRO 2.1.31 and WordPress 7.1 on both sites.

Short Answer

Get the users’ password hashes from the old site with WP-CLI (wp user list --fields=user_login,user_email,user_pass,…) or from the wp_users table in phpMyAdmin. On the new site, import the file in Import > Users with the hash column mapped to Password. The import recognises the hash and stores it unchanged, so the old passwords work.

Step 1: Export the Users with Their Hashes

The plugin’s own user export never includes passwords or hashes, on purpose: an export file is often shared or emailed, and a hash is a credential. To move hashes, read them directly on the old site. With WP-CLI:

wp user list --fields=user_login,user_email,display_name,roles,user_registered,user_pass --format=csv > users-with-hashes.csv

Without WP-CLI, export the same columns of the wp_users table in phpMyAdmin and add the roles from the plugin’s user export. In our test, the file had three users:

user_login user_email display_name roles user_pass
nina.berger nina.berger@example.com Nina Berger author $wp$2y$10$SMzC…
paul.martin paul.martin@example.com Paul Martin editor $wp$2y$10$xS9v…
sara.costa sara.costa@example.com Sara Costa subscriber $wp$2y$10$Kahp…

Treat this file like a list of passwords: keep it off email and shared drives, and delete it after the import.

Step 2: Import on the New Site

In Import Export by RockStarLab > Import, we chose Users and uploaded the file. Auto Map mapped all six columns, including user_pass to Password:

User import Mapped Fields: user_login, user_email, display_name, roles, user_registered and user_pass
The hash column is mapped to Password.

On the Options step, existing users are matched by email: Update for matches, Create for new users:

User import Step 5 with Check for Existing Items by Email, If Match Found Update and If No Match Found Create
Users are matched by email.

All three users were created:

Import finished: 3 successful, 0 updated, 3 created, 0 skipped, 0 failed
Three users created with their old password hashes.

On the new site, each user signed in with the password from the old site: WordPress’s own login check accepted Demo-Nina-2026! for nina.berger, and the same for the other two. Roles and registration dates came over too.

Which Hashes Work

  • WordPress 6.8 and newer ($wp$2y$…, bcrypt): work as they are.
  • Older WordPress ($P$…, phpass): work; WordPress converts them to the new format the next time each user logs in.
  • Other applications that use standard bcrypt ($2y$…), such as Laravel: work, because WordPress checks them with PHP’s own password functions. We tested a bcrypt hash created outside WordPress. Argon2 hashes ($argon2id$…) work the same way when the server’s PHP supports Argon2.
  • Anything else, such as MD5 or SHA-1 strings or plain text: the import treats the value as a new password and hashes it. A plain-text value becomes the user’s password; a foreign hash string doesn’t work as a password, so those users need a reset.

Things to Know

  • Existing users keep their password. When a user with the same email already exists on the new site, the import updates the other columns but not the password; changing passwords of existing users needs the import’s update_password option, which is off by default. The hash is applied to users the import creates.
  • Your own account is protected: the import doesn’t change the role of the administrator who runs it, or remove the last administrator.
  • Same security keys are not needed. Hashes don’t depend on the site’s salts in wp-config.php, so they work on a site with different keys.
  • Content Sync copies users between connected sites without passwords; see syncing users between sites.

Before importing, back up the site, or ask your AI agent to start the backup.

With an AI agent

Import Export by RockStarLab gives AI agents its exports, imports and Content Sync as abilities. Through the WordPress MCP Adapter, WordPress itself offers an agent only read-only abilities for site, user and environment information, so without the plugin the agent cannot do the steps above (to connect an agent, see connecting Claude Code to WordPress). With it, one request is enough:

With Import Export by RockStarLab, list the users registered most recently with their username and role.

In our run, the agent called rsl-ie-pro/export-preview for users, newest first, with the fields username, roles and registration date. The first three were nina.berger (author), paul.martin (editor) and sara.costa (subscriber).

FAQ

Can I migrate WordPress users with their passwords?

Yes, as hashes. Export the user_pass column from the old site with WP-CLI or phpMyAdmin and import it as Password; the import keeps the hash, and users log in with their old passwords.

Why doesn’t the user export include passwords?

An export file is easy to share by mistake, and a password hash is a credential. You read hashes directly on the old site only when you need them.

Will users get an email after the import?

Not by default. The import sends WordPress’s new-user emails only when its send_notification option is turned on, and it is off unless you set it.

Do password hashes from other systems work?

Standard bcrypt hashes work, and Argon2 hashes where PHP supports them, because WordPress checks them with PHP’s password functions. Other formats need a password reset.

Get the free plugin on WordPress.org. User import is part of PRO.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

Have a question or a tip to share? Leave it below.

Leave a comment

Your email address will not be published. Required fields are marked *

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE