Yes it’s very easy. You’ll want to use the add_role() function to add your custom roles – https://codex.wordpress.org/Function_Reference/add_role
Then you can use add_cap to add custom capabilities – https://codex.wordpress.org/Function_Reference/add_cap
One important thing to mention is that both add_role and add_cap are saved to the database so they only need to run 1x so it’s good to hook these functions into theme_switch, load-themes.php or if it’s in a plugin using register_activation_hook
There is also another good answer can be found here with an example: Apply custom role capabilities to administrator (without plugin)
Related Posts:
- How can I restore admin capabilities?
- What determines whether admin toolbar is shown to a logged-in user?
- How do you set up a WordPress blog with multiple authors to allow something like StackExchange’s “community wiki” feature?
- WordPress Remove Submenus
- current_user_can(‘administrator’) not working in custom login
- Redirect admin 403 “Cheatin uh?” admin pages
- How do I remove dashboard access from specific user roles?
- Prevent author from changing their posts if admin has modified
- Make A WordPress Page Accessible To Admins Only, Redirect Other User Roles
- How to remove administrator role in settings -> general -> New User Default Role?
- Create un-removeable user
- Read only capability for custom post in admin area
- Custom CSS In Admin Only For Certain Roles
- Remove ability to access certain admin menus
- Remove admin AND editor from the “change role to” menu in user listing
- Role that can edit only widgets, not other theme options
- How to remove “Super Admin” from All Users for those that are not a “Super Admin”?
- Customize the upload screen
- Blocking Administrative Access to Authors and Subcribers?
- Customize Admin Users Screen based on Role
- Make certain pages uneditable by editors?
- Restrict dashboard access for specific user roles to specific actions
- Admin cannot publish
- Only Admin can Edit, Delete or Update
- add_cap for editor but no admin role
- Shared account / dual blogging in WordPress
- Bind custom role to admin page
- remove menus for a specific role?
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- How to make sure your admin doesn’t hi-jack you site?
- Remove specific administrator’s capability
- Given multiple admin accounts, how can I make it so that only admin with X username can edit posts
- How should I setup the “Users” area to hand over to a client?
- solution to prevent specific admins from altering site contents
- Admin user roles/permissions
- “sufficient permissions” error for admin after duplicating WP database to new install
- Posts in sidebar only by admin
- How to hide plugin options for editors via functions.php
- Give admin_menu permission to specific users
- Cannot access wp-admin after installing SSL – user capabilities not being set
- Redirect non-admin after login, and in url – /admin
- Hide top admin panel for non admin and non editors
- Different role for free and pro users in wordpress without using bbpress
- Capability to read/edit page in wp-admin only for administrators
- I don’t have permission to save the theme options I created myself?
- Different customer login form than administrator login form?
- What are the standard admin CSS id/class tags?
- The website cannot display the page
- Set Default Admin Colour For All Users
- Settings API – easiest way of validating checkboxes?
- initial sort order for a sortable custom column in admin
- Uploading files in admin panel?
- Redirect Admin User in Dashboard
- Conditional check for front-end which includes ajax
- Hide update messages from non-admin users?
- Reorder plugin items in the admin menu
- Reference external file as a function
- “Automatically add new top-level pages” Default
- Get email address of type Administrator
- How to get all users with Author role capabilities?
- Calling a shortcode in the backend
- How to allow “Add New” capability of CPT when links to its UI are placed as a submenu?
- How to check if a role has a specific capability
- Is there a way to have admins that are logged in to wordpress not have to enter the password for password protected pages while browsing the website?
- How to receive security update notification email?
- How to restrict wp-admin and prevent upload errors
- How to determine if an admin is logged in outside the loop
- Adding text in more than one language (at the same time)
- How to get view count of every page on site and add that (increasing) number to Dashboard Widget
- How do I remove All and Published if not admin?
- Are User Levels Still Currently Used?
- How do I restrict user access to plugins?
- Dashboard menu missing
- Role capability issue
- add_role user capability not working
- Admin role not really admin
- Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite
- Featured image on post edit page not loading over HTTPS
- How do I diagnose a plugin resource 404?
- Change Name of Category Heading in New Post
- Admin bar is disabled in front
- Other than save_post any other actions on add / edit post screen?
- Plugin permissions for Editor role
- Add JavaScript in admin in custom plugin [duplicate]
- Restrict access to custom post type based on its taxonomy terms
- Hide media library images from other roles uploaded by admin
- Allow contributor user role to perform copy operation PHP
- Enable plugins for a specific user role
- how to disable the e-mail verification on wp-admin/options-general.php multisite admin e-mail
- conditionally update css on edit.php
- Simple CSS admin pagination
- Can I show the tag admin interface on a post when logged in as an admin?
- Making a custom upload form and page in the admin section
- WordPress gallery image link gives 404 when not logged in
- Remove “minor-publishing” div from Publish admin metabox
- New User Notification – Setting Email
- You do not have permission to access this document on form submit
- Woo Commerce Settings for Check-out Form [closed]
- Add custom css class to wp-list-table row for custom post type
- Custom column with post ID not working in CPT