From the course: WordPress: WP-CLI

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Interacting with comments

Interacting with comments - WordPress Tutorial

From the course: WordPress: WP-CLI

Start my 1-month free trial

Interacting with comments

- [Instructor] Managing comments en masse can be a pain, but the process is much easier with wp comment. You can list, approve, update, or even easily delete spam. If we check out the help page, we can see there's a number of commands similar to post theme and plugin. Those include list, get, and status, as well as create, delete, and update. And there's even a generate subcommand to create dummy comments. But there are also commands that are comment-specific: approve, record, spam, and unspam. So let's take a closer look at these and the first thing we'll do is get the list of the most recent 25 comments. We can do that by writing wp comment list dash dash number equals 25. Now, these options are going to match the key value pairs for the wp comment query object and arguments. So instead of post per page here, we have number. And you can see we have the comment ID, the comment post ID, the date if it's approved, the…

Contents