WordPress is the largest CMS and provides lots of facilities to its users. Moreover, the WordPress custom user roles facility eases the work by distributing the Work of the site.
Basically, WordPress provides five default user roles to you. Each role has different capabilities. What about if you want to give access to the roles that these users don’t have. In that case, you need to add custom user roles on your WordPress site.
WordPress can create a user with roles that default users don’t have. This article will let you know how to add custom user roles on your WordPress site.
What are the WordPress custom user roles?
By installing WordPress, you will get five default WP roles. These default WP roles are:
An administrator is a person who has full control over your site. Moreover, he can make any changes he likes. For example: adding and deleting users of your site, installing new plugins and themes, creating and deleting pages and posts, changing the roles of the user, etc.
In one sentence administrator has full power over your site. So you need to cautious before choosing an administrator for your site.
An editor is a person who monitors the work that the author and contributor do and perform content management activities. He can also edit and delete the content and pages.
An author is a person who can create and edit their own posts but doesn’t have any control over another person’s post. He is only capable of writing, editing, and publishing his posts.
They don’t have any publishing ability. They have only the right to write, edit and delete the posts. Furthermore, the contributor is a more confined version of the author’s ability as they don’t have publishing access.
A subscriber is a person who uses the site and subscribes to it. They can only see your post and subscribe and share the post. Subscribers can also modify his or her profile.
Adding WordPress custom user roles on your site
WordPress provides five default WP roles for your site. These roles are administrator, editor, author, contributor, and subscriber. What about if you want to add customize roles that these default WP roles don’t have.
In this case, WordPress will also provide you the facility to add custom user roles on your WordPress site. Learn more about how to create your WordPress site for free. You can also add custom user roles programmatically or add them by installing plugins. WordPress adds user roles programmatically but it seems difficult to the people who don’t have coding knowledge.
So, let’s find out the process of adding custom user roles on your site by using plugins and by coding.
Following are the steps of adding custom user roles on your site by using the plugin:
Step one: Install plugin to add WordPress custom user roles.
first, you need to install a plugin on your site. After that, Go to your WordPress dashboard and click plugin>> add new.
Then search for user role editor plugin in the search plugin box.
After that install it and activate that plugin.
By this plugin you can edit the role of user easily as you like.
Step two: Add WordPress custom user roles.
Go to your WP dashboard and click user roles editor.
You can add a new user role by clicking the add role option. For adding custom user roles on your WordPress site click add roles.
Then fill role name ( ID ), display role name, and select none in make copy of section.
You can add work of default role with the new custom role by selecting any other default role in making a copy of section option.
Then mark the roles that you want to give access to your new custom user. After that click update and press ok in the confirmation message.
Go to your WordPress dashboard then you will see that your custom user is already added with the default WordPress roles.
Adding custom user role by coding:
WordPress is well known for its customization facility. You can add a custom user role on your WordPress site which is called add_role.
add_role function has three parameters:
add_role($role, $display, $capabilities);
If you want to add New_editor post who can own his post and edit it then you need to copy the following code in your function.php file. You can find it in the theme folder.
add_role('New_editor', __( 'New_editor'), array( 'read' => true, // Allows a user to read 'create_posts' => true, // Allows user to create new posts 'edit_posts' => true, // Allows user to edit their own posts ) );
Press the update file option. Then login by your admin account. Go setting>> General.
Then you can see new editor role in your new user default role.
Before adding WordPress custom user roles, you need to create your site effectively that not only attracts your customers but also drives them to purchase your service. You can do it by WP Travel.
As you know how to add custom user roles on your WordPress site, you can easily add new users and give them access to the roles you desire. WordPress adds new user roles that help you to distribute your work among the users.