Skip to content

Instantly share code, notes, and snippets.

@priscillamc
Last active January 2, 2020 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priscillamc/6a5173ef94c51f55d12dc78b3dd23968 to your computer and use it in GitHub Desktop.
Save priscillamc/6a5173ef94c51f55d12dc78b3dd23968 to your computer and use it in GitHub Desktop.

WP-CLI Commands

Change WordPress Multisite Roles Using WP-CLI

Changing super-admin role (multisite):

> wp super-admin list

> wp super-admin remove EMAIL_ADDRESS

> wp super-admin add EMAIL_ADDRESS

Remove a user's access to a site dashboard (multisite):

> wp user list --role=administrator

> wp user remove-role USER_ID --url=NETWORK_SITE_DOMAIN/SITE_NAME

Change an existing user's access on a site to subscriber (multisite):

> wp user set-role USER_ID subscriber --url=NETWORK_SITE_DOMAIN/SITE_NAME

Change an existing user's login username

> wp db query 'SELECT ID, user_login FROM wp_users WHERE ID = ...'
> wp db query 'UPDATE wp_users SET user_login = "..." WHERE ID = ...;'

Capabilities

Give an editor access to the Yoast SEO menu and advanced options

wp cap add editor wpseo_manage_options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment