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?
- Getting a List of Currently Available Roles on a WordPress Site?
- Editor can create any new user except administrator
- Admin Ajax is returning 0
- Add custom column to Users admin panel
- Is there way to rename user role name without plugin?
- How to create a clone role in wordpress
- wp_verify_nonce vs check_admin_referer
- Add a Separator to the Admin Menu?
- How to determine whether we are in add New page/post/CPT or in edit page/post/CPT in wordpress admin?
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- how to know if admin is in edit page or post [duplicate]
- Modal window from within WordPress admin
- Where in WP can I check history or log of updates of plugins etc?
- Adding a custom admin page
- How does admin-ajax.php work?
- How to add a Capability to a User Role?
- Select subscriber as author of post in admin panel?
- How can I get a list of users by their role?
- Remove update nags for non-admins [duplicate]
- Give Editor Access To Sidebar
- Remove Ability for Other Users to View Administrator in User List?
- How to remove entire admin menu?
- How do I make a draft post accessible to everyone?
- Reset default roles and capabilities
- How can I speed up my WP admin section?
- How to pass parameters to admin_notices?
- What action should I hook into when adding roles and capabilities?
- Admin: very slow edit page caused by core meta query
- if admin is logged in
- Search posts by ID in admin
- add_role() run only once?
- How to Change the Default Home Page for the WordPress Dashboard?
- Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
- Find out which moderator approved comment?
- Custom post type role permissions won’t let me read
- The website cannot display the page
- How To Remove WordPress Version From The Admin Footer
- Sort pages in loop by admin’s page attributes order field?
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- Edit “thank you for creating with WordPress” in version 3.3.1
- Hide other users’ posts in admin panel
- Set Default Admin Colour For All Users
- Editor Styles and Typekit
- Allowing custom role access to custom post type in back end
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- WordPress admin stylesheet
- This CSS Stuffing Works, But Is This A Good Practice?
- Is it possible to create a WordPress tour? V3.3.1
- Securing Admin Accounts – Username Discovery
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- What do unfiltered_html and unfiltered_upload actually filter?
- is_admin() returns true when using admin-ajax.php from front end script