Do you want to allow someone with less authority in your WordPress website to perform some specific tasks? WordPress gives you the option to include this amazing feature on your website. Besides the predefined user roles, you can create a custom user role for certain tasks and allow him to access your dashboard with limited leadership.
Well, in this article, we will cover how you can create custom user roles in your website and how to assign them to its users.
so, let’s begin!
A User Role is a built-in feature of WordPress that helps to set which tasks a user may or may not perform on your website. There are six defined user roles in WordPress. You can read our article “What are WordPress User Roles” to know details about WordPress User Roles and the responsibilities of each user role.
Now, there are two ways you can apply to create a custom user role. One is by adding code manually and the other one is with a plugin. It fully depends on you which one you choose to apply.
But we will recommend you if you aren’t familiar with coding you can create with the help of a plugin.
Below, we describe the two ways of creating the custom user role as
Besides the predefined WordPress User role, you can create WordPress custom user roles with a sort of coding.
In WordPress, a function called add_role() is used to create a custom user role. It has three parameters and each parameter serves a different function.
add_role( $role, $display_name, $capabilities );
Here,
Now, To create the custom role according to your requirement, you have to follow the given steps,
It’s actually a warning message as it can break your theme design if you made some mistakes. Now, click on the “I understand” option.
add the new user role add_role( 'content_writer', 'Content Writer', array( 'read' => true, 'edit_posts' => true, 'delete_posts' => false ) ); } add_action('admin_init', 'ui_new_role');
After putting the file, now click on the Update File option to save the current changes. That’s it. Your coding part is done.
That’s all, Now, from the WordPress admin panel you can appoint a new user to this custom user role.
If the existing WordPress user roles don’t fit your needs, you can either add additional responsibilities or just create custom user roles using a plugin. There are lots of plugins you can choose but here we will recommend using the User Role Editor plugin. The plugin will allow us to assign specific roles to users, also you can edit all existing user role capabilities with a few clicks.
Let’s learn how to use this plugin:
If multiple people are working on your WordPress website, creating custom user roles for them can come in handy in that scenario. Moreover, it helps you to define specific user access. In addition, with it, you can also differentiate users by creating user levels. So you should learn the approach of creating a custom user role for your website.
Hopefully, this article will help you to understand the methods of creating a custom user role in WordPress. For more about WordPress, you may check our WordPress Tips and How-To’s to know more about WordPress.
If this article will help you, then please subscribe to our YouTube channel to get more tutorials related to WordPress. You may join our Facebook page to update yourself with more tips, solutions, offers and so on.
You may also ask any questions in the comment or want us to write on some specific topics you have in your mind. We appreciate your further comments, support or suggestions!