Adding custom user roles in WordPress lets you control access to specific parts of your website, making it easier to manage large teams, multi-author blogs, or membership sites. Whether you’re running an online store, a learning platform, or a content-heavy site, defining roles with tailored permissions ensures better security and workflow management.

You don’t need to be a developer to add custom roles. Here’s how to create and manage them using both plugins and manual code methods.


Why Create Custom User Roles in WordPress?

WordPress comes with six default roles:

  • Administrator: Full control over the entire website.
  • Editor: Manage and publish content but no access to settings.
  • Author: Publish their own posts only.
  • Contributor: Write posts but cannot publish.
  • Subscriber: Read-only access.
  • Super Admin: Only available in WordPress Multisite installations.

These roles work for basic setups, but as your site grows, you may need custom roles for better control. For example:

  • Content Manager: Can publish and manage posts but not install plugins.
  • SEO Specialist: Access to SEO settings without content editing rights.
  • Support Staff: View user tickets without backend access.

Custom roles help to keep your site secure and organized.


Method 1: Adding Custom User Roles Using a Plugin (Recommended)

The easiest way to create and manage custom user roles is through a plugin. One of the most popular is User Role Editor.

Steps to Add a Custom Role Using User Role Editor:

  1. Install the Plugin:
    • Go to Plugins > Add New.
    • Search for User Role Editor.
    • Click Install Now and Activate.
  2. Create a New Role:
    • Go to Users > User Role Editor.
    • Click Add Role.
    • Provide a role name (e.g., “Content Manager”).
    • Choose an existing role to copy capabilities from (optional).
    • Click Add Role.
  3. Assign Capabilities:
    • Select the new role.
    • Enable or disable permissions by checking the boxes.
    • Click Update to save.
  4. Assign the New Role to a User:
    • Go to Users > All Users.
    • Edit a user profile.
    • Select the new role from the Role dropdown.
    • Click Update User.

Pros of Using a Plugin:

  • No coding knowledge needed.
  • Visual interface for easy management.
  • Reversible changes without coding risks.

Method 2: Adding Custom User Roles Manually with Code

If you prefer working directly with code or want a lightweight setup without plugins, you can create custom roles by adding code to your theme’s functions.php file or a custom plugin.

Example Code to Create a Custom Role:

function add_custom_user_role() {
    add_role('content_manager', 'Content Manager', [
        'read' => true,
        'edit_posts' => true,
        'delete_posts' => true,
        'publish_posts' => true,
        'upload_files' => true,
        'manage_categories' => true
    ]);
}
add_action('init', 'add_custom_user_role');

Key Capabilities Explained:

CapabilityPermission Granted
readBasic site access (viewing posts).
edit_postsEdit existing posts.
delete_postsDelete posts.
publish_postsPublish new posts.
upload_filesUpload media files.
manage_categoriesManage post categories and tags.
edit_theme_optionsEdit theme settings (for admins).

Remove a Custom Role:

function remove_custom_user_role() {
    remove_role('content_manager');
}
add_action('init', 'remove_custom_user_role');

Modify an Existing Role:

function modify_editor_role() {
    $editor = get_role('editor');
    $editor->add_cap('edit_theme_options');
}
add_action('init', 'modify_editor_role');

Method 3: Using Code Snippets Plugin (Best for Beginners)

If you want to avoid touching your functions.php file but still need a code-based solution, the Code Snippets plugin is perfect.

Steps to Use Code Snippets Plugin:

  1. Install Code Snippets Plugin:
    • Go to Plugins > Add New.
    • Search for Code Snippets.
    • Install and Activate.
  2. Add New Snippet:
    • Go to Snippets > Add New.
    • Paste the code from the example above.
    • Save and activate the snippet.

Need Help Adding Custom Roles to Your WordPress Site?

Hire a certified WordPress expert from Codeable to set up custom roles, fine-tune permissions, and ensure your site runs smoothly.

Get a Free Estimate

FAQs About Adding Custom User Roles in WordPress

1. Can I create a custom user role without a plugin?

Yes, by adding code directly to your functions.php file or using the Code Snippets plugin. This method provides full control over user permissions but requires basic coding knowledge.

2. What’s the difference between a role and a capability?

A role is a collection of capabilities. Capabilities define specific actions a user can perform, such as editing posts or installing plugins. A role bundles those capabilities together for easier management.

3. Will my custom roles disappear if I change themes?

If the code is added in the theme’s functions.php file, it will be lost with a theme switch. To avoid this, use a site-specific plugin or the Code Snippets plugin, ensuring roles persist through theme changes.

4. Can I restrict WooCommerce access for a custom role?

Yes, create a role that can manage orders but not access global WordPress settings. This can be done using User Role Editor or by defining capabilities manually with code.

5. Is there a way to bulk assign custom roles?

Yes, the Import Users from CSV with Meta plugin can handle bulk assignments by allowing you to upload a CSV with user data and assign roles based on a dedicated column.

6. Can I create a custom role for editors to manage posts only?

Yes, you can create a restricted editor role using User Role Editor or manually by defining limited capabilities that focus solely on post management.

7. How do I test if my new role is working?

Create a test user, assign the custom role, and log in with the test account to verify its limitations. Ensure the user can only perform the actions specified for that role.


Adding custom user roles in WordPress helps you manage your team and secure your site more effectively. Whether using a plugin like User Role Editor or coding manually, both methods offer great control over user permissions. Stick to the method that suits your experience level and site complexity.