Whenever someone signs up to your WordPress website, the platform stores their information within a database (much like every other aspect of your website). At some point, you may want to save the information. Fortunately, getting it out of WordPress intact is relatively simple.
By default, WordPress includes built-in export and import options. You can use these to save your user databases and migrate them. There are a lot of situations where this functionality can come in handy, and this piece will discuss them. Weβll also show you two ways to import and export user databases in WordPress.
Letβs get right to it!
Why You Might Need to Handle User Databases in WordPress
In a nutshell, databases are collections of information arranged using tables and variables. If that sounds like a spreadsheet, you wouldnβt be wrong. The main difference between spreadsheets and databases is the latter relies on βlinksβ between your tables. These connections make it much easier to pull the information you need from specific tables and keep the whole system updated.
As we said, your entire website is stored in a database. WordPress will usually create a new database by default for each of your websites sharing the same server space. Most of your siteβs information is stored within, includingΒ your postβs content, their authors, and any essential metadata. While itβs not always the case, your database also stores all of your websiteβs user information. Because itβs well-organized, exporting it isnβt too much trouble. Hereβs why the functionality can come in handy:
- You can export users from one website to another.Β This is useful if youβre merging two sites, for example.
- It enables you to save your user list.Β You can use this information for marketing purposes or with third-party software.
- You can save your user list locally for easier access.Β If you have a local copy of your user list, you can refer to it instantly any time you want. Plus, you can update the list anytime you want by exporting your user database again.
The good news is WordPress already includes built-in import and export functionality that can handle some of its data. However, this feature doesnβt support user databases out of the box, which brings us to the next section.
How to Import and Export User Databases in WordPress (2 Methods)
In this section, weβll cover two solutions to this problem, one using a plugin and one without. Letβs start with the plugin approach. Weβd be remiss if we didnβt mention that before you make any changes on your website β especially ones that make drastic edits to your database β you should definitely take a backup. Using a plugin is the fastest way to capture your website in its entirety,y so that if in the event something goes sour, you donβt lose your website completely.
Now that thatβs out of the way, letβs get into these databases!
1. Use a Plugin to Import and Export User Databases
If you check out your WordPress dashboard, youβll notice two tabs calledΒ ImportΒ andΒ ExportΒ underΒ Tools:
When you go to theΒ ExportΒ tab, youβll see the option to save most of your WordPress websiteβs data, including its posts, comments, pages, custom fields, categories, and tags. Your user list, however, isnβt part of the package by default. If you want to add this functionality to WordPress, youβll need to use a plugin such as Import Export WordPress Users & WooCommerce Customers:
Despite its mouthful of a name, this plugin gets our vote because it adds the exact functionality we need in a simple fashion. After you install and activate it, youβll see a newΒ User Import ExportΒ tab appear underΒ UsersΒ within WordPress. Inside, there should be an option to import your user database at the top of the screen:
Weβll come back to this later, but for now, scroll down and look for the section readingΒ Export Users in CSV Format. Now choose which user roles you want to export β in this case, yourΒ Subscribers:
Ignore theΒ OffsetΒ option, which is only helpful if you want to skip specific lines within your tables, and leave theΒ LimitΒ setting unchanged. Scroll down again now and youβll see a list of all the tables the plugin will export. Some of those names should be recognizable since they include usernames, passwords (encrypted, of course), emails, first and last names, and more:
Once youβve reviewed the settings, click on theΒ Export UsersΒ button at the bottom of the screen. The plugin will now save your user database in CSV format β in other words, a common spreadsheet.
To import those users to another website, youβll need to install the Import Export WordPress Users & WooCommerce Customers plugin on it. When youβre ready, return to theΒ Users > User Import ExportΒ tab in WordPress, and click theΒ Import UsersΒ button at the top of the screen. Now youβll be able to choose the CSV file from your computer and upload it:
The importing process may take a while depending on how big your spreadsheet is. The plugin will also merge the user database you import with your existing one, which means itβs best to import your database into a pristine website to avoid running into problems.
2. Export User Data from Your WordPress Database
As we mentioned earlier, WordPress saves the majority of information to a database unique to each website. The previous method enabled you to interact with your database through a plugin. However, you can also accomplish the same results by accessing it manually.
To do so, weβll need to use a tool such as phpMyAdmin, which enables us to interact with our WordPress databases. If your web host uses cPanel, you should have access to phpMyAdmin there:
In many cases, web hosts not using cPanel can still provide you with a way to interact with your database, so check your providerβs documentation to see what options you have. Moving on, once you enter phpMyAdmin, youβll see a list of your existing databases on the left-hand side. If youβre hosting a single website, you should only see one database, which you can expand by clicking on the Plus sign next to its name:
If you pay attention to the table names, youβll see thereβs an option readingΒ wp_usersΒ or similar (this can change depending on your host). Thatβs the table we care about, and once itβs opened, youβll see a list of your existing WordPress users. There should be a menu at the top of the screen showing several options, including ones readingΒ ImportΒ andΒ Export:
Click onΒ Export,Β and youβll be able to export your user database inΒ SQLΒ format, although you can also choose from other options such as CSV, which is better if you want to browse your database locally. There arenβt any settings to play around with here, so simply click theΒ GoΒ button:
Now phpMyAdmin will save a copy of your database to your computer. You can open a CSV using any spreadsheet software you want. You can also go ahead and import it into another websiteβs database using theΒ ImportΒ option within phpMyAdmin. When you click on it, youβll see an option to choose a file to import:
Just choose the database backup you created earlier and make sure to indicate what format itβs in. Then scroll down and click on theΒ GoΒ button once more. Keep in mind that this method will override your existing userβs table, unlike the plugin approach we used earlier. This means itβs best used on a new website, unless you donβt mind losing your existing users.
Conclusion
WordPress makes it easy for you to export your user list and save it to other devices in CSV format. Moreover, you can import user databases from other sites if youβre merging two properties. Plenty of other platforms can also interpret CSV files, so itβs always a good idea to have an up-to-date copy of your user list saved.
As far as how to get access to your user database goes, WordPress provides you with two approaches:
- Use a plugin to export and import your users table.
- Locate your databaseβsΒ UsersΒ table and export its contents.
Do you have any questions about how to import and export user databases in WordPress? Letβs talk about them in the comments section below!
Article thumbnail image by Sky Designs / shutterstock.com.
Using the second approach with phpMyAdmin to export the _users table, do you also need to export the _usermeta table?
Great article do you know if the import and export plugin will handle woo commerce customers AND order history? Perhaps only in the premium version.. any articles you could point me too on this subject ? thank you
Hi, please let me know if I have purchased a theme from your company via & for use with Shopify; is it possible to use the theme on wordpress.com as Shopify is e-commerce and does not support blogs, social media plugins reviews multi-merchant etc. Thanks
I have a copy of the invoice and paid $180.00 if I remember correctly.
Thanks again
Thanks You So Much
For The Post of How to Import and Export User Databases in WordPress.
This is very very Helpful Article
Hi, I just created a blog and need information on how to reach out to this world. Please advise and how to improve blogging skills.
Great Stuff β on point and informative as ever!