[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!


who are we?

DART Creations is run by David Attard - working in and around the web design niche for more than 12 years, we provide actionable tips for people who work with and on websites. We also run DronesBuy.net - a website for drone hobbyists

David attard

Follow us on Social





Popular Content

Joomla extensions to take your website to the NEXT level

Is your Joomla website reaching its full potential? We install many of these extensions on almost ALL of our Joomla sites - why don't you check them out our list of Joomla Extensions and see whether you can take your site to the next level?

Where are we hosted?

This site is proudly powered by FAST VPS InMotion Servers and given an insane speed thanks to MaxCDN!

Web Hosting MaxCDN - Speed up your website


InMotion Hosting Review - Recommended Web Hosting servers for business, Joomla, WordPress and ecommerce websites.

InMotion Hosting Review

Advertise on DART-Creations.com

DART Creations is interested in developing partnerships with mutual benefit. If you like the stuff we publish and would like to develop a relationship, we'd be happy to hear from you. Go on - drop us a line - we'd love to hear from you :-)

The Outstanding HunGRYJPEG Bundles

AWESOMENESS! Bundles of premium font + graphic packs at more than 96% OFF!  Get this bundle for just $29 - This month ONLY!

The Hungry JPEG Awesome font bundles

New! DIVI 3.0 WordPress TeMPLATE + PageBuilder - 10% OFF Limited Launch offer

You'll surely create a perfect website with Divi 3.0!

Divi 3