Welcome to Geeklog, Anonymous Saturday, November 23 2024 @ 07:29 pm EST
Geeklog Forums
using mysql to remove comments
Hi,
I'm still a newb to MYSQL, but have discovered the database is full of comment spam. I'm performing queries to match spammy substrings (of my choosing) and then performing queries on IP addresses and noting the outcome. Some of these latter queries are returning (so far) up to 1500 comments per IP. I'm then using another query to delete all comments matching the IP. This could take some time.
But it's occurred to me that I might be missing something and other tables beside gl_comments might need things adjusting due to my deletions?
I've found one article with 10668 comments on it.
Any recommendations!?
Cheers!
I'm still a newb to MYSQL, but have discovered the database is full of comment spam. I'm performing queries to match spammy substrings (of my choosing) and then performing queries on IP addresses and noting the outcome. Some of these latter queries are returning (so far) up to 1500 comments per IP. I'm then using another query to delete all comments matching the IP. This could take some time.
But it's occurred to me that I might be missing something and other tables beside gl_comments might need things adjusting due to my deletions?
I've found one article with 10668 comments on it.
Any recommendations!?
Cheers!
12
14
Quote
Status: offline
Laugh
Site Admin
Admin
Registered: 09/27/05
Posts: 1470
Location:Canada
Before playing around with MySQL try using the SPAM-X plugin that comes installed with Geeklog.
You can add ips and your own words that will trigger the spam filter when a user tries to post something.
You can also delete spam comments after they have been added. See this link on the demo site for an example:
http://demonext.geeklog.net/admin/plugins/spamx/index.php?command=MassDelete
Tom
One of the Geeklog Core Developers.
You can add ips and your own words that will trigger the spam filter when a user tries to post something.
You can also delete spam comments after they have been added. See this link on the demo site for an example:
http://demonext.geeklog.net/admin/plugins/spamx/index.php?command=MassDelete
Tom
One of the Geeklog Core Developers.
14
8
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by: sirromj
But it's occurred to me that I might be missing something and other tables beside gl_comments might need things adjusting due to my deletions?
The comment count in the story also needs to be updated. More importantly, though, is that comments are stored in a tree structure, which needs to be re-balanced. This can not easily be done manually.
So, please try Tom's suggestion (using the Spam-X Mass Delete option) first.
If that doesn't help, writing a short piece of custom code that calls CMT_deleteComment() for each comment to be deleted would be another option. Just don't mess with the gl_comments table directly.
bye, Dirk
10
5
Quote
All times are EST. The time is now 07:29 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content