WordPress roles and capabilities

2020-06-04: Copied to recipes.op111.net

Current as of 28 June 2019, WordPress 5.2. See populate_roles().

Capability Administrator Editor Author Contributor Subscriber
read + + + + +
delete_posts + + + +
edit_posts + + + +
delete_published_posts + + +
edit_published_posts + + +
publish_posts + + +
upload_files + + +
delete_others_pages + +
delete_others_posts + +
delete_pages + +
delete_private_pages + +
delete_private_posts + +
delete_published_pages + +
edit_others_pages + +
edit_others_posts + +
edit_pages + +
edit_private_pages + +
edit_private_posts + +
edit_published_pages + +
manage_categories + +
manage_links + +
moderate_comments + +
publish_pages + +
read_private_pages + +
read_private_posts + +
unfiltered_html + +
activate_plugins +
create_users +
delete_plugins +
delete_themes +
delete_users +
edit_dashboard +
edit_files +
edit_plugins +
edit_theme_options +
edit_themes +
edit_users +
export +
import +
install_plugins +
install_themes +
list_users +
manage_options +
promote_users +
remove_users +
switch_themes +
unfiltered_upload +
update_core +
update_plugins +
update_themes +

WordPress CLI commands

A selection of WP-CLI commands.

Command Comment
sudo -u USERNAME -- wp COMMAND Runs COMMAND as user USERNAME
sudo wp cli update Updates WP-CLI itself
wp core update --version=VERSION --force Downgrades WordPress to specified VERSION (e.g., 5.0.2)
wp db cli Opens a MySQL console using credentials from wp-config.php
wp db export --add-drop-table Exports database adding DROP TABLE before each CREATE
wp media image-size Lists registered image sizes
wp media import *.png Adds all PNG files in current directory to the media library
wp media regenerate Regenerates thumbnails for one or more attachments
wp plugin list --status=active Lists all active plugins
wp plugin list --status=inactive Lists all inactive plugins
wp post delete 99 Deletes (to bin) post with ID 99
wp post delete $(wp post list --cat=9 --format=ids) Deletes (to bin) all posts in category with ID 9
wp post delete $(wp post list --post_status=trash --format=ids) Deletes all posts from the trash
wp post update $(wp post list --author=1 --format=ids) --post_author=2 Trasfers all entries by user with ID 1 to user with ID 2
wp post-type list Lists registered post types
wp search-replace 'a' 'b' --skip-columns=guid Replaces a with b in database skipping the guid column
wp term list category Lists categories
wp user list --orderby=ID Lists users ordered by ID