Last active
September 8, 2021 21:31
-
-
Save kadimi/1a04d5bfe7cc60d42f11956de9eda5dd to your computer and use it in GitHub Desktop.
Disable comments on all attachments using WP-CLI - #wordpress #spam
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
# /bin/sh | |
# Disable comments on all attachment posts using WP-CLI - #wordpress #spam | |
wp post update --comment_status=closed $(wp post list --post_type=attachment --format=ids) | |
# | |
# Sample Output | |
# ============= | |
# Success: Updated post 3. | |
# Success: Updated post 2. | |
# Success: Updated post 1. | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment