Unlock Hidden Powers: Transform Your WordPress Workflow with WP-CLI Today!
wp comment list
However, this doesn’t always include spam comments in the list. To see spam comments, use this command:
wp comment list --status=spam
Then, to delete the spam comments, use the wp comment delete command with the wp comment list command:
wp comment delete $(wp comment list --status=spam --format=ids)
The above are just a few examples of how you can use WP-CLI to interact with your WordPress site outside of the WP Admin interface.
Hopefully, this has inspired you to start interacting with WordPress from the command line.
								


                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
                                    
Post Comment