Created
February 25, 2015 16:38
-
-
Save jplhomer/646927e569548bca4f4e to your computer and use it in GitHub Desktop.
Disable all comments/pings in WordPress with WP-CLI
This file contains hidden or 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
$ 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... |
This file contains hidden or 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
$ 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
I would share these with
closed
, yes and empty string will end up asclosed
in the database, but I think it's confusing. Setting them withtrue
or1
will NOT enable them back on, you need to useopen
. It's not a boolean, as I thought originally.I just made a little post about it as I ran into this and dug deeper.