How to Add a Custom Role in WordPress (Without Plugin)

Not everyone who manages website content needs to have administrative privileges. Therefore, we need to assign each user a role based on need. It’s a great security measure and can better ensure against mishaps or even someone binge-installing random or dangerous plugins.

There are some built-in user roles in WordPress ready to use, from the most privileges to the website management to the least are:

  • Administrator
  • Editor
  • Author
  • Contributor
  • Subscriber.

We will show you each role’s capabilities in a table, but not all capabilities are listed as WordPress has lot more capabilities. However, it’s a good way for an overall understanding of what each user role can or can’t do.

ou can learn more about the various role capabilities that WordPress offers.

But while the default user roles are useful, there are times when you need those extra capabilities for a specific role. Large organizations may have several different types of content, with specific people in mind to manage each one. In this case, a default user role wouldn’t be ideal. For example, you need the capabilities of the Author role with the ability to moderate comments on their own posts. And that’s what we will do.

In this article, we will show you how to create a custom user role without any plugin. We will create a custom user role named “Author Pro” for demonstration. It will include all capabilities of the author role with the additional ability to moderate the comments on their own posts.

Step 1: Open the Theme Function(function.php)

Firstly, go to Appearance → Theme File Editor on the WordPress dashboard, it will take you to the Edit Themes page, go to Theme Files section and select Theme Functions(function.php).


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *