[How to] Delete Kunena Forum and Comment SPAM

We at DART Creations have a few clients who are still running old version of Kunena forums. These are quite stable and have no known issues and thus some clients have no need to upgrade (and hence they don't). As long as the codebase has no security issues, this should not be an issue.

However, what is an issue with these old versions is the lack of anti-spam features. The only one which seems to effective is moderatingthe forums completely to stop the content SPAM from getting published. This however puts a huge administrative burden of having to delete all the SPAM which makes it into the moderation. It is extremely tedious to remove this SPAM one by one, especially since there is no SELECT ALL option when approving or deleting messages.

At DART Creations, when we don't find a easy solution to something however, we don't stop looking. Instead we hack into the code / SQL or whatever is required.

To resolve this problem we dug into the SQL tables ofand found that moderated messages have a hold column value of 1. Thus if we approve only the messages we want to show it is quite easy to delete the rest of the stuff directly from the Kunena tables. So you can just advise your clients to only approve the stuff they want, and once in a while you can delete the rust of the stuff from the Joomla / Kunena database tables.

Below is the SQL Query to delete ALL the moderated messages.


The following command will delete ALL MODERATED messages. Wrong DELETE statement can delete ALL YOUR DATA! Handle with care. TAKE BACKUPS!! We are not responsible and will not support you if you break your website or your forum!


DELETE FROM `jos_fb_messages_text` WHERE MESID IN
(SELECT ID FROM `jos_fb_messages` WHERE HOLD=1);

DELETE FROM `jos_fb_messages` WHERE HOLD=1

There is the possiblity that the name of the tables is slightly different than the above. The latest iterations of Kunena are named slightly different but the command in essence is the same:

DELETE FROM `bak_kunena_messages_text` WHERE MESID IN
(SELECT ID FROM `bak_kunena_messages` WHERE HOLD=1);

DELETE FROM `bak_kunena_messages` WHERE HOLD=1

One more thing...

Do you have friends or a Facebook group who you think would find this useful? Share this with them and then let me know what they think.

Want to supercharge your website?

Our website loads FAST ... just 1.29 seconds. We're hosted on FAST InMotion VPS servers We want YOUR website to be fast too, so we've gotten you an exclusive deal - 47% OFF for DART Creations friends + FREE domain! Check it out NOW!