WordPress is probably the best CMS (Content Management System) application to create dynamic websites easily. It shortens your development time and makes you comfortable.
In my previous post, I discussed about How to rename user roles in WordPress. It will be a nice solution if you have below or equal to 5 member types in your site. But, if you need more member types?
Nothing to be worried mate. You can create new user types easily. There are 2 ways, creating a brand new role with selected capabilities or cloning an existing user role!
How to clone a user role?
Just decide, which existing user role are you going to copy or clone for your WordPress? This copy means- copying capabilities of an existing user role! Let’s assume, we are going to create a new user role ‘Writer’ which will have similar capabilities as existing user role ‘Author’.
Copy the code below and paste them into
functions.php of your theme (located at
$wp_roles = new WP_Roles();
$auth = $wp_roles->get_role('author');
$wp_roles->add_role('writer', 'Writer', $auth->capabilities);
How to add a new user role?
This is so simple as above example. Copy the code below, open your
functions.php file and paste them. It creates a new user role ‘Blogger’ who can read, (write) and edit posts, but cannot delete them. (Please go to this page to know the List of capabilities WordPress has.)
$result = add_role(
__( 'Blogger' ),
'read' => true,
'edit_posts' => true,
'delete_posts' => false,
That’s it. Try it yourself and let me know if you face any difficulties.