Skip to content

Instantly share code, notes, and snippets.

@kadimi
Last active September 8, 2021 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadimi/1a04d5bfe7cc60d42f11956de9eda5dd to your computer and use it in GitHub Desktop.
Save kadimi/1a04d5bfe7cc60d42f11956de9eda5dd to your computer and use it in GitHub Desktop.
Disable comments on all attachments using WP-CLI - #wordpress #spam
# /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