wp comment <command>

Creates, updates, deletes, and moderates comments.


# Create a new comment.
$ wp comment create --comment_post_ID=15 --comment_content="hello blog" --comment_author="wp-cli"
Success: Created comment 932.

# Update an existing comment.
$ wp comment update 123 --comment_author='That Guy'
Success: Updated comment 123.

# Delete an existing comment.
$ wp comment delete 1337 --force
Success: Deleted comment 1337.

# Delete all spam comments.
$ wp comment delete $(wp comment list --status=spam --format=ids)
Success: Deleted comment 264.
Success: Deleted comment 262.

Top ↑


Name Description
wp comment approve

Approve a comment.

wp comment count

Count comments, on whole blog or on a given post.

wp comment create

Create a new comment.

wp comment delete

Delete a comment.

wp comment exists

Verify whether a comment exists.

wp comment generate

Generate some number of new dummy comments.

wp comment get

Get data of a single comment.

wp comment list

Get a list of comments.

wp comment meta

Manage comment custom fields.

wp comment recount

Recalculate the comment_count value for one or more posts.

wp comment spam

Mark a comment as spam.

wp comment status

Get status of a comment.

wp comment trash

Trash a comment.

wp comment unapprove

Unapprove a comment.

wp comment unspam

Unmark a comment as spam.

wp comment untrash

Untrash a comment.

wp comment update

Update one or more comments.

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