User Role Editor WordPress plugin – Change roles easily

User Role Editor - plugin for WordPress

User Role Editor

User Role Editor WordPress plugin allows you to change standard WordPress user roles capabilities with easiness of a few mouse clicks. Just turn on check boxes of capabilities you wish to add to the selected role and click “Update” button to save your changes. That’s done. Add and tune your own custom roles which you can assign to the users then. You can create new role as a copy of existing one. Delete self-made roles. Change defaul user role.
Multi-site support is provided.

Why it could be necessary? Let’s suppose you wish that your multi-authored blog contributors upload their own graphics to use in their posts. WordPress “contributor” role has no such capability by default. In such situation you have needed to change user role capabilities manually using SQL client as I described at “How to change wordpress user role capabilities” post, if you have enough knowledge in that field. But what to do if you have not?


Good news – This task is simple now, just use this plugin

User Role Editor

The latest version: 4.25.2. Quant of downloads: 2829258
download

Change roles

Take a look at the “User Role Editor” plugin main form (click to open image in the original size):
user-role-editor-main

  • Select a role you wish to change from the drop down list at the top. Page will be refreshed automatically and show you the capabilities list for the selected role. Make your corrections, check/uncheck correspondent check boxes and click “Update” button to save your changes. If you wish to apply this change for all sites of your multi-site WordPress network, turn on “Apply to All Sites” check box at the top of the form before press “Update”.
  • If you prefer to see capabilities names in form e.g. ‘Edit pages’ instead of WordPress ‘edit_pages’ standard form turn on the “Show capabilities in human readable form” checkbox at the right top corner of the main form. Move mouse over capability name and you will see its alternative form name.
  • According to WordPress Codex User Levels were introduced in WordPress 1.5, they were replaced by Roles and Capabilities in WordPress 2.0, and were finaly deprecated in WordPress 3.0. Thus you can hide them in order they do not mess you in your work with roles. Keep “Show deprecated capabilities” check box at the to right corner of the form unchecked for that. If for any reason you need to see user levels, turn on that check box.
  • If you don’t wish to save changes you can click “Cancel” button.
  • If you are needed to restore roles capabilities you have before your or installed plugins made 1st modification to them, use “Reset” button. “User Role Editor” will restore roles and capabilities to its clean state. You will get roles stuff just after WordPress installation. Be very careful with this operation as you will definitely lose any changes you or your plugins made to user roles from the time of fresh WordPress installation. Consider to make backup copy of your database before proceed with “Reset” operation.

In order to add/remove your custom role, change default role for new user, add/remove custom user correspondent buttons from the right toolbox panel.

  • If you need your own custom role, create it with “Add Role” button. Input new role name into input text field at “Add New Role” box, select existing role from drop-down list if you wish to use its capabilities as starting point for further work and click “Add” button. Remember that you can use latin letters, digits and an “_” underscore sign in your role names. Subscriber role is copied by default if you don’t select such role yourself.
    user-role-editor-add-new-role
  • Unnecessary self-made role can be deleted with “Delete Role” button. Select role and click “Delete” button for it. Only custom roles appear in the list of roles available for deletion. If some role is assigned to the user or selected as default role for new users it will not appear in this list. Option “Delete all unused roles” is available.
    user-role-editor-delete-role
  • Select the role which you wish to use as default for any new created user from the list opening “Default Role” box by click at the “Default Role” button.
    user-role-editor-default-role
  • Use “Add Capability” button in order to add new user capability. Remember you can use only latin alphabet letters, digits and underscore sign in the capability name.
    user-role-editor-add-capability
    How to use new added user capability? Turn it on in the role you select and check if current user has such capability in your plugin or active theme functions.php file. For example,

     if (!current_user_can('some_capability_you_added')) {
       echo "You don't have permission for it!";
       return;
    }
  • If you need delete custom capability added by you or some of your old plugins, which you don’t use anymore use “Delete Capability” button. “User Role Editor” doesn’t allow to delete built-in WordPress capabilities and capabilities which are used by any role.

This video prepared by Webucator.com shows the installation and basic usage of User Role Editor WordPress plugin:

User permissions management

With help of “User Role Editor” you can assign additional capabilities directly to the users. Open users list by click on the “All Users” link at the “Users” submenu. Find needed user, move mouse pointer to his name and click “Capabilities” link as on screenshot below:
User Capabilities Editor link
At the form opened you can assign to user another role and/or add to him capabilities which not included to his role:
Change User Capabilities
You can not turn off capabilities included to the role assigned to this user. You can add/remove other capabilities. They will be applied directly to the user as you click the “Update” button. If you wish to built a fully custom capabilities set for this user, without limitation of any role, select “No role for this site” from drop-down list at the top and make it.

User Role Editor Settings

User Role Editor has its own options page under the WordPress Settings menu (under Network Admin is plugin was network activated).
user-role-editor-settings

User Role Editor Pro

Do you need more functionality with premium support in real time? Do you wish remove advertisements from User Role Editor pages?
Buy Pro version. It includes extra modules:

  • Block selected admin menu items for role.
  • “Export/Import” module. You can export user roles to the local file and import them then to any WordPress site or other sites of the multi-site WordPress network.
  • Roles and Users permissions management via Network Admin for multisite configuration. One click Synchronization to the whole network.
  • Per posts/pages users access management to post/page editing functionality.
  • Per plugin users access management for plugins activate/deactivate operations.
  • Per form users access management for Gravity Forms plugin.
  • Shortcode to show enclosed content to the users with selected roles only.
  • Posts and pages view restrictions for selected roles.

Pro version is advertisement free. Premium support is provided by plugin author Vladimir Garagulya. You will get an answer on your question not once a week, but in 24 hours or quicker.

User Role Editor

For more information about WordPress user roles please read these articles
WordPress Admin Menu Permissions;
WordPress user capabilities;
activate_plugins WordPress user capability;
edit_dashboard WordPress user capability;
Delete posts and pages WordPress user capabilities set;
delete_plugins WordPress user capability;
moderate_comments WordPress user capability;
Roles and Capabilities article at codex.wordpress.org;

Translations

If you wish to check available translations or help with plugin translation to your language visit this link
https://translate.wordpress.org/projects/wp-plugins/user-role-editor/

Русская версия этой статьи доступна по адресу ru.shinephp.com

Dear plugin User,
If you wish to check available translations or help with translation visit this link
https://translate.wordpress.org/projects/wp-plugins/user-role-editor/

Special Thanks to

  • Lorenzo Nicoletti – for the code enhancement suggestion CUSTOM_USER_META_TABLE constant is used now for more compatibility with core WordPress API.
  • Marcin – For the code enhancement. This contribution allows to not lose new custom capability if it is added to other than ‘Administrator’ role.
  • FullThrottle – for the code to hide administrator role at admin backend.

You are welcome! Help me with bugs catching, share with me new ideas about plugin further development and link to your site will appear above.

Change Log

[4.25.2] 03.05.2016

  • Update: Enhanced inner processing of available custom post types list.
  • Update: Uses 15 seconds transient cache in order to not count users without role twice when 'restrict_manage_users' action fires.
  • Update: URE fires action 'profile_update' after direct update of user permissions in order other plugins may catch such change.
  • Update: All URE's PHP classes files renamed and moved to the includes/classes subdirectory

[4.25.1] 15.04.2016

  • Fix: Selected role's capabilities list was returned back to old after click "Update" button. It was showed correctly according to the recent updates just after additional page refresh.
  • Update: deprecated function get_current_user_info() call was replaced with wp_get_current_user().

[4.25] 02.04.2016

  • Important security update: Any registered user could get an administrator access. Thanks to John Muncaster for discovering and wisely reporting it.
  • URE pages title tag was replaced from h2 to h1, for compatibility with other WordPress pages.
  • Fix: "Assign role to the users without role" feature ignored role selected by user.
  • Fix: PHP fatal error (line 34) was raised at uninstall.php for WordPress multisite.
  • Update: action priority 99 was added for role additional options hook action setup.

[4.24] 17.03.2016

  • Fix: PHP notice was generated by class-role-additional-options.php in case when some option does not exist anymore
  • Enhance: 'Add Capability' button have added capability to the WordPress built-in administrator role by default. It did not work, if 'administrator' role did not exist. Now script selects automatically as an admin role a role with the largest quant of capabilities and adds new capability to the selected role.
  • New: User capabilities page was integrated with "User Switching" plugin - "Switch To" the editing user link iss added if "User Switching" plugin is available.
  • Marked as compatible with WordPress 4.5.

[4.23.2] 03.02.2016

  • Fix: PHP warning "Strict Standards: Static function URE_Base_Lib::get_instance() should not be abstract" was generated

[4.23.1] 01.02.2016

  • Fix: 'get_called_class()' function call was excluded for the compatibility with PHP 5.2.*
  • Fix: ure-users.js was loaded not only to the 'Users' page.

[4.23] 31.01.2016

  • Fix: "Users - Without Role" button showed empty roles drop down list on the 1st call.
  • Update: Own task queue was added, so code which should executed once after plugin activation is executed by the next request to WP and may use a selected WordPress action to fire with a needed priority.
  • Update: Call of deprecated mysql_server_info() is replaced with $wpdb->db_version().
  • Update: Singleton patern is applied to the URE_Lib class.
  • Minor code enhancements

[4.22] 15.01.2016

  • Unused 'add_users' capability was removed from the list of core capabilities as it was removed from WordPress starting from version 4.4
  • bbPress user capabilities are supported for use in the non-bbPress roles. You can not edit roles created by bbPress, as bbPress re-creates them dynamically for every request to the server. Full support for bbPress roles editing will be included into User Role Editor Pro version 4.22.
  • Self-added "Other Roles" column removed from "Users" list, as WordPress started to show all roles assigned to the user in its own "Role" column.
  • 'ure_show_additional_capabilities_section' filter allows to hide 'Other Roles' section at the 'Add new user', 'Edit user' pages.

Click here to look at the full list of changes of User Role Editor plugin.

FAQ

– Does it work in multi-site environment?
Yes, it works with multi-site installation. By default plugin works for every blog from your multi-site network as for locally installed blog without multi-site feature.

URE Multi-site feature

URE Multi-site feature


To update selected role globally for all Network you should turn on the “Apply to All Sites” checkbox.

– How to duplicate my custom created roles from main blog of my multi-site network to new created one?
“User Role Editor” makes it for you automatically. As new blog added to your network, “User Role Editor” copies full roles staff from your main blog to the new created one.

– Why administrators of single site of multi-site network do not see “User Role Editor” under “Users” menu?
URE is disabled for single site administrator by default. If you wish to enable it for single site adminitstrator add this line of code into your blog wp-config.php file

define('URE_ENABLE_SIMPLE_ADMIN_FOR_MULTISITE', 1);

Do not forget about the own User Role Editor’s user capabilities set.
In order local administrator finally get access to the “User Role Editor” you have to add ‘ure_edit_roles’ user capability to the ‘administrator’ role. User Role Editor capabilities are added to the ‘administrator’ automatically for the single WordPress installation only.

– I have large multi-site network. After click “Update” button with “Save to all sites” checkbox turned on nothing is happened. I got the blank page.
It is PHP script execution time limit problem. Other network update method is available as alternative from version 3.5. Due to my tests it works approximately 30 times faster. Try it. It will be great, if you share your experience with me. In order to select alternative method of all sites update add this line to you blog wp-config.php file

define('URE_MULTISITE_DIRECT_UPDATE', 1);

It does nothing automatically, just select other algorithm when you press “Update” with “Apply to All Sites” checkbox turned on next time.
If you define WP_DEBUG equal to 1 or true constant in wp-config.php file, URE with this directive shows update execution time in milliseconds as additional technical information.

– How to edit “Administrator” role? I don’t see it in the roles drop down list.
“Administrator” role is hidden from the roles drop down list by default.
You can see/edit “Administrator” role starting from version 3.4. Insert this line of code

  define('URE_SHOW_ADMIN_ROLE', 1);

into your wp-config.php file and login with administrator account for that.
If for any reason your “Administrator” role missed some capabilities added by plugins or themes, you can fix that now. But be careful with changing “Administrator” role, do not turn off accidentally some critical capabilities to not block your admin users.

– Does it work with WordPress versions prior 3.0?
Starting from version 2.2 plugin works with WordPress 3.0 and higher only. For earlier WordPress versions use plugin version 2.1.10

download

I am ready to answer on your questions about this plugin usage and help with possible problems. Use User Role Editor plugin forum or this page comments and site contact form for that please.

Thanks,
Vladimir ShinePHP.com

Tags: , , , ,

  • mark

    hi, i have about 10 users id like to be able to buy private products on my site, ive changed on of the roles, to allow them to Read private products but when logged in they still cant see them. am i doing something wrong?

  • Green Hope

    Hi! I recently updated the latest plugin (4.20.1) two weeks ago. With version 4.20, our “contributor” role was able to see several links on our page but now, they are unable. When I do a restore of our file to the 4.20 version, the contributor role was able to access the links in question, so I know it is something to do with the latest release.

  • Hi!

    The difference between 4.20 and 4.21 is: “Primary default role” drop-down menu was not shown at “Settings – User Role Editor – Default Roles” tab for WordPress single site installation.

    If you compare these versions source code you will see that is true. This changes could not influence contributor role as it never has access to the User Role Editor Settings page.

    Could you provide more details in order I may repeat your issue yourself? About what links do you write?

  • WP Developer

    Hi,

    This is a really great plugin. Here’s my question. I have set-up user roles/groups and assigned them certain posts and pages. The problem is I was only wanting to have restricted access on the backend. However, I am noticing this is restricting access to anyone who comes to the site on the front-end. Is there a way to make all front-end pages visible to any non-logged in users? Thanks!

  • Bernie Raffe

    The ‘User Role Editor’ option under ‘Users’ ha disappeared and so there is no way of bringing up the User Role Editor plugin (WordPress version is 4.4.1 , User Role Editor version is 4.23.1). Maybe it’s been moved somewhere else, but I can’d find it!

  • It should be still there, under “Users” menu. Is the same menu item available under the “Settings” menu?
    Try to deactivate plugin and activate it back.

  • Bernie Raffe

    Yes, that did it, it’s back now. Thank you

  • David

    Hi Vladimir, thank you for this great plug-in. I am new to it and WordPress admin as I have just taken over site utilising this. We have a word press site using this plug in and I am having trouble giving any users apart form Admin or Editor the ability to create posts… Please screen shot of what I have selected within Admin but which isn’t revealing the add a post under the specific User Role. Any ideas gratefully received. Thank you.

  • ‘edit_posts’ is used by default to allow create new posts and edit existing own posts. Try to deactivate all plugins and re-test. I suppose that some plugin may change this default permissions.

  • Organik Soft

    Hi Vladimir, I need to add custom capability. Do you maybe have some tutorial on that? I know how to add capability but I need to know how to define it. We have plugin on website for re-ordering posts and I would like to add capability for post reordering to Author. Now only Administrator can re-order posts. Thanks In Advance, Marko

  • Anon

    Heads up: on multisite uninstall, craps out with undeclared variable “wpdb” line 32 – needs “global $wpdb” declaration to precede it.

  • Thank you. This issue was reported already. It will be fixed with the next update.

  • Mach

    Hi Vladimir, Your plugin is very nice, I´m using it. My question is: Is there any possibility to change the default sentence for private sites when the user is not loged id?

  • Ryan Johnson

    Hell Vladimir. Love what this plugin does but I need help with one area. I’m sure it’s just something I’m missing: I can create a role that allows the person to create and publish a page but the “Categories” section is grayed out. How can I fix that so the author can select a category?

  • ‘edit_posts’ is enough to select categories at the post editor page. If it is not, look at the plugins. Some may modify the default behaviour.
    This may vary for the custom post types though. For example WooCommerce product requires ‘assign_product_terms’ capability in order to select ‘Product Categories’ at the editor page.

  • Ryan Johnson

    Not posts, PAGES like I said. User designated as “Editor” can do it (right side of the image). The new role of “Manager” (left image) does not allow for it. This is the whole reason we purchased this plugin.

  • Hi Ryan,

    If you will use forum at https://www.role-editor.com or contact me directly as Pro version registered user you will get a response much faster.

    WordPress pages don’t have categories by default. Some customization done at your site. So I can not give you an exact answer. The straight forward way to find needed capability is to start from a copy of the editor role and exclude capabilities one by one until user with this custom role will not lose access to the categories meta box at the page editor.

    You may start from adding ‘edit_posts’ capability though. If that will help, it’s possible to block access to the ‘Posts’ menu via ‘admin menu access’ additional module:
    https://www.role-editor.com/block-admin-menu-items

  • ronaldus

    Is there a support section on this site?
    I have a small problem with the pro-version and the theme settings of sub-sites in my MS install that I’d like to show/discuss…

    Cheers!

  • For Pro version support you may login and register topic at the forum:
    https://www.role-editor.com/forums
    or write directly to support email