Last active
April 16, 2024 10:56
-
-
Save vineettalwar/e23dae83cc2ea45a1f37d54606e94952 to your computer and use it in GitHub Desktop.
WP CLI Useful commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Delete all blog comments which are marked as pending | |
wp comment delete $(wp comment list --status=hold --format=ids) --force | |
// Get comments from specific post ID: | |
wp comment list --post_id={POST_ID} --fields=ID,comment_author | |
// Get comments form specifc post from specific comment status | |
wp comment list --post_id={POST_ID} --status=hold --fields=ID,comment_author | |
// Mark as spam to comments on a specific post with status hold | |
wp comment spam $(wp comment list --post_id={POST_ID} --status=hold --format=ids) | |
// Delete comments on a specific post with status hold | |
wp comment delete $(wp comment list --post_id={POST_ID} --status=hold --format=ids) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment