For WordPress users seeking to modify user roles efficiently, WP-CLI provides a convenient solution. WP-CLI is a command-line interface that allows users to manage their WordPress installations directly from the terminal.
By utilizing WP-CLI, users can easily change the roles of various users within their WordPress site, granting them different levels of access and capabilities. This powerful tool eliminates the need to navigate through the WordPress admin dashboard and offers a streamlined approach for users who are comfortable with command-line operations.
With WP-CLI, users have the flexibility to assign appropriate roles to individuals, ensuring the right level of control and permissions for their website's collaborators. Whether you're a developer, a site administrator, or an advanced user, WP-CLI empowers you to efficiently manage user roles within your WordPress ecosystem.
This article will explain how to change user roles using WP-CLI.
Related Articles
SSH into Shared Server
Find the Document Root of a Domain
Change Role
- Access your server via SSH using the Terminal in cPanel, located in the Advanced section
- Navigate to the site's document root using the cd command
EXAMPLE:cd public_html
REPLACE: public_html with the domain's actual Document Root. - Run the following command
wp user update 123 --role=administrator
REPLACE: 123 with the appropriate user ID that is being updated.
REPLACE: administrator with the role that the user will be updated to.
NOTE: These are the available roles: Administrator, Editor, Author, Contributor, Subscriber, Super Admin.
TIP: For more information, review the WordPress CLI Documentation.