Skip to content

Instantly share code, notes, and snippets.

@mlangone
Forked from jplhomer/disable-comments.sh
Created September 11, 2019 16:37
Show Gist options
  • Save mlangone/5a4a4b4dd1842acb39d5995e9c6e762c to your computer and use it in GitHub Desktop.
Save mlangone/5a4a4b4dd1842acb39d5995e9c6e762c to your computer and use it in GitHub Desktop.
Disable all comments/pings in WordPress with WP-CLI
$ wp post list --format=ids | xargs wp post update --comment_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
$ wp post list --format=ids | xargs wp post update --ping_status=closed
# Output:
# Success: Updated post 2514.
# Success: Updated post 2511.
# Success: Updated post 2504.
# Success: Updated post 2499.
# Success: Updated post 2441.
# etc...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment