Created
November 4, 2009 17:47
-
-
Save nateware/226241 to your computer and use it in GitHub Desktop.
Bulk updating Wordpress comments
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
-- Bulk updating your pending Wordpress comments as spam when you have thousands of them. | |
mysql> select comment_approved, count(*) from wp_comments group by comment_approved; | |
+------------------+----------+ | |
| comment_approved | count(*) | | |
+------------------+----------+ | |
| 0 | 2052 | | |
| 1 | 3 | | |
| spam | 441 | | |
+------------------+----------+ | |
3 rows in set (0.01 sec) | |
mysql> update wp_comments set comment_approved = 'spam' where comment_approved = 0; | |
Query OK, 2052 rows affected (0.25 sec) | |
Rows matched: 2493 Changed: 2052 Warnings: 0 | |
mysql> commit; | |
Query OK, 0 rows affected (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment