How to Export and Import WordPress User Capabilities

This week, a PublishPress user asked us the following question:

“I was wondering if there is a way for us to copy-and-paste roles and permissions over from one website to another website, so that we don't have to set up the permissions for each website we have to make.”

The answer to that question is “Yes”, thanks to the PublishPress Capabilities plugin.

This tutorial should be effective for any permissions that are created using the normal WordPress permissions system.

After installing PublishPress Capabilities, you can check that your permissions are exportable by going to “Capabilities” in your WordPress admin area. If you see the permissions on this screen, they can be exported. If you can not see your permissions, you'll need to talk with the developers of the plugin that creates those permissions.

Screenshot of WordPress roles and permissions

Step #1. Create your backup

  • Go to “Capabilities” then “Backup”.
  • Click the blue “Do Action” button. This will create a backup of your current site's roles and capabilities.
Create a backup for WordPress roles and permissions

Step #2. Export and Import your backup

This step will need database access. You require phpMyAdmin or a similar database tool.

  • Find your WordPress database.
  • Find the wp_options table. Note that the actual table name will have the database prefix which was defined for your site.
  • Find the row with option_name capsman_backup.
  • If you don't have a capsman_backup row, use the capsman_backup_initial row.
Database table for WordPress roles and permissions

Export this capsman_backup row. You can either export it using your database tool, or you can edit the row and copy-paste the content:

Import WordPress roles and permissions

If you want more on this, check out our complete guide to WordPress user permissions in the database.

Now you can go to your other WordPress site.

  • Find the wp_options table (with your database prefix)
  • Find the row with option_name capsman_backup or capsman_backup_initial.
  • Replace this row's option_value with the option_value data from the other site.

Step #3. Install the new permissions

Now we need to install the permissions that we've just imported.

  • Log in to your new site.
  • Go to “Capabilities”, then “Backup”.
  • Choose the backup that you just imported.
  • Click “Restore Selected Roles”.
  • You'll see a message “Roles and Capabilities restored from backup.”
Restore Roles
Restore Roles 1

Step #4. Test your new permissions

Finally, don't just assume this has worked. Test your new site and make sure the permissions have imported correctly.

If something is wrong, you can visit the Users > Capabilities screen and make adjustments to the permissions.

More PublishPress Capabilities tutorials

Get full PublishPress access

Join PublishPress today and you'll get powerful publishing and permissions plugins to improve your WordPress site.

  • Steve Burge

    Steve is the founder of PublishPress. He's been working with open source software for over 20 years. Originally from the UK, he now lives in Sarasota in the USA. This profile is generated by the PublishPress Authors plugin.

Leave a Reply

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