Back to all posts

WordPress: User roles and permission.


WordPress is a popular content management system that allows users to create and manage websites. WordPress provides a system of user roles and permission to control what users can and connot do within the website.

Here are the default user roles in WordPress, from lowest to highest level of permission:

  1. Subscribers: A user with the subscriber role can only view content and manage their own profile
  2. Contributor: A user with the contributor role can create and edit their own posts, but cannot publish them
  3. Author: A user with the author role can create and publish their own posts, as well as edit and delete them.
  4. Editor: A user with the editor role can manage all posts and pages, including those of other users and pages, including those of other users, and publish them.
  5. Administrator: A user with the administrator role has full control over the website, including access to features settings and plugin.

WordPress also allows for customer roles and permissions to be created using plugin or custom code.

Custom roles and permission can be useful for managing access to specific areas giving them full managing access to specific areas of the website like if you can custom post type like Events then you can give only that post type CRUD functionality.

I recommend you use Members plugin.

Plugin Link: https://wordpress.org/plugins/members/

For example If you want to create Event Manager Role so i create new role name Event Manager in Member plugin interface.

If this events are from custom post type you need to add below code in custom post type

'capability_type' => 'event',
'map_meta_cap' => true,

This two line of code show you custom post type menu in members plugin grant permission menu items.

Now we create new role.

Goto Member Plugin Menu > Add New Role

Enter member role name and grant permission for them.

Now if u create new user there you can get “Event Manager Role”

If a new user with Event Manager role login his backend interface look like this.