How to Export and Import WordPress Permissions

This week, a PublishPress user asked us an interesting 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 Capability Manager Enhanced plugin.

The Capability Manager Enhanced plugin for WordPress

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

After installing Capability Manager Enhanced, you can check that your permissions are exportable by going to “Users” then “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 “Tools” then “Capability Manager”.
Menu link to backup WordPress roles and permissions
  • 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

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 “Tools” then “Capability Manager”.
  • Choose “Restore last saved backup”.
  • Click “Do Action”.
Restore last saved backup for WordPress roles and permissions

You’ll see a message “Roles and Capabilities restored from last backup.”

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.

Leave a Reply

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

Professional publishing plugins for WordPress! Get PublishPress

[i]
[i]