Wp comment (WP-CLI)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen

wp comment creates, updates, deletes, and moderates comments.

https://developer.wordpress.org/cli/commands/comment/:

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.

wp comment delete

Bv.:

> wp comment list
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+
| comment_ID | comment_post_ID | comment_date       | comment_approved | comment_author     | comment_author_email  |
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+
| 1          | 1               | 2017-10-13 13:02:3 | 1                | A WordPress Commen | wapuu@wordpress.examp |
|            |                 | 7                  |                  | ter                | le                    |
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+

> wp comment delete 1
Success: Trashed comment 1.

wp comment list

Bv.:

> wp comment list
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+
| comment_ID | comment_post_ID | comment_date       | comment_approved | comment_author     | comment_author_email  |
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+
| 1          | 1               | 2017-10-13 13:02:3 | 1                | A WordPress Commen | wapuu@wordpress.examp |
|            |                 | 7                  |                  | ter                | le                    |
+------------+-----------------+--------------------+------------------+--------------------+-----------------------+