WP-CLI

A command line interface for WordPress

Commands » post

wp post - Manage posts.

Quick links: Github issues


EXAMPLES

# Create a new post.
$ wp post create --post_type=post --post_title='A sample post'
Success: Created post 123.

# Update an existing post.
$ wp post update 123 --post_status=draft
Success: Updated post 123.

# Delete an existing post.
$ wp post delete 123
Success: Trashed post 123.

SUBCOMMANDS

Name Description
create Create a new post.
delete Delete an existing post.
edit Launch system editor to edit post content.
generate Generate some posts.
get Get details about a post.
list Get a list of posts.
meta Manage post custom fields.
term Manage post terms.
update Update one or more existing posts.