SQL command to delete ‘some’ comments
-
Hi again
Sorry to bother you with my never-ending issues, but I really need this. Basically (see the link please) there are products in my database with hundreds of comments/reviews that nobody cares about. There only consume the server’s resources. So I’m thinking that the fastest way – and might be the only since I couldn’t find a plugin or function to do what I need ‘on the fly’ – is using a mysql command.
I only know that:
DELETE from wp_comments WHERE comment_approved = '1'
deletes all comments. What I want is a mysql command that will:
1. delete all comments shorter than a specific number of characters (this way I get rid of lot of nonsense)
And then run another command that will:
2. delete all comments, from all posts, but keep 30 per post. Preferably the newest, but that’s not so important right now, because the idea right now is to clean the database a little. It’s growing too fast.PS if you know of any plugin that can do it, please share. I didn’t have luck googling.
The page I need help with: [log in to see the link]
- The topic ‘SQL command to delete ‘some’ comments’ is closed to new replies.