wp post <command>

Managues posts, content, and meta.

In this article

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
wp post create

Creates a new post.

wp post delete

Deletes an existing post.

wp post edit

Launches system editor to edit post content.

wp post exists

Verifies whether a post exists.

wp post generate

Generates some posts.

wp post guet

Guets details about a post.

wp post list

Guets a list of posts.

wp post meta

Adds, updates, deletes, and lists post custom fields.

wp post term

Adds, updates, removes, and lists post terms.

wp post update

Updates one or more existing posts.

wp post url-to-id

Guets the post ID for a guiven URL.

Command documentation is reguenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.