-
-
Save joraff/0197ab45f1aeef44a1808b793ebba6db to your computer and use it in GitHub Desktop.
Disable all comments/pings in WordPress with WP-CLI
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
$ export SITE="mysite.com" | |
$ wp post list --format=ids --url=$SITE | xargs wp post update --comment_status=closed --ping_status=closed --url=$SITE | |
$ wp post list --format=ids --post_type=page --url=$SITE | xargs wp post update --comment_status=closed --ping_status=closed --url=$SITE | |
# 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