=== Ultimate Comment Cleaner – Remove Spam & Unwanted Comments, Delete Comments in Bulk ===
Contributors: wpunicorn, spartac
Tags: remove comments, delete comments, remove spam, comment spam, bulk delete comments
Requires at least: 5.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Plugin URI: https://wordpress.org/plugins/ultimate-comment-cleaner/
Author URI: https://profiles.wordpress.org/wpunicorn/

Comment cleaner: remove spam and unwanted comments, delete comments in bulk, automate removing comments with smart rules and a safe quarantine.

== Description ==

**Ultimate Comment Cleaner** is a comment cleaner that removes spam and unwanted comments for you. It automates removing comments with smart rules (keywords, writing system, links), keeps what it catches in a quarantine you can restore from, and lets you delete comments in bulk from one screen.

Hit by Russian gambling spam, Chinese link spam, fake pharmacy offers or "buy followers" comments? Pick a ready-made rule, test it on your existing comments to see exactly what it would catch, then switch it on. Nothing is deleted until you decide.

It works on top of Akismet or any other anti-spam plugin, and it adds no external service, account or API key.

= What you can do with it =

* **Remove spam comments by content** - keywords, Russian/Cyrillic, Chinese, Japanese, Korean and other writing systems, links, short comments.
* **Automate removing comments** - rules check every new comment and also run hourly, daily or weekly on existing comments, so spam and unwanted comments are cleaned up without you lifting a finger.
* **Quarantine instead of delete** - every caught comment is hidden but restorable, and removed automatically after the number of days you choose.
* **Delete spam comments in bulk** - clean up thousands of spam, pending or old comments in batches that do not time out.
* **Bulk delete comments by filter** - status, date range, post type, author, search text, links and word count, with a preview count first.
* **Manage every comment in one place** - search by text, name, email, website or IP, and approve, spam, quarantine, edit or delete in bulk.
* **See what is happening** - a dashboard with trends, spam insights and rule accuracy for the last 7, 30 or 90 days.

= Smart Rules: catch spam by what it says =

Rules check **new comments as they arrive** and can clean up **existing comments on a schedule**. A rule can look for:

* **Keywords and phrases** - whole word (`casino`), word start (`casino*`), anywhere (`*casino*`) or a regular expression. English, Russian and any other language.
* **Writing system** - flag comments written mostly in Cyrillic, Chinese, Japanese, Korean, Arabic, Thai, Hebrew, Hindi or Greek.
* **Links** - comments with N or more links, or a website filled in.
* **Short comments** - fewer than N words. Combine with "ALL" for rules such as "short comment with a link".
* **Where to look** - comment text, name, email or website.
* **Status and age** - for existing comments, such as "pending comments older than 30 days".

Ready-made rules to start from: Russian/Cyrillic text, Gambling spam (English and Russian), Chinese/Japanese/Korean text, Link stuffing, Short comment with a link, Pharmacy spam, Crypto and get-rich-quick, SEO and promotion spam, Adult content.

What a rule does when it matches is up to you: **move to quarantine** (recommended), **mark as spam** or **delete permanently**. You can pause a rule at any time without losing its settings.

= Test before you trust it =

Every rule has a **Test on existing comments** button. It shows how many comments would match, a sample of them and why, and changes nothing. One click opens the matches in the comment list, where you can approve, spam, quarantine or delete them individually or in bulk.

= Quarantine: restore any mistake =

Caught comments are hidden from your site but not lost. The Quarantine screen shows which rule caught each comment and why, lets you **restore** or delete them, and removes them automatically after the number of days you choose. A comment you restore is never caught by your rules again.

= Dashboard =

Stat tiles with trends, comments per day by status, how many comments your rules stopped, when spam arrives, and which writing systems, websites and words show up in spam. A rule performance table shows how many comments each rule caught and how often you had to restore them, and plain-language suggestions point out what needs attention. Every chart has a table view, and nothing is loaded from outside your site.

= Manage Comments =

A full comment list inside the plugin: search by text, name, email, website or IP, filter by links, website and date, see spam signals under each comment (links, writing system), and approve, unapprove, mark as spam, quarantine, edit or delete in bulk.

= Bulk Clean =

Delete, mark as spam or quarantine comments in bulk with filters for status, date range, post type, author, search text, links and word count. Preview the count first. Large clean-ups run in batches with a progress counter, so they do not time out. Export matching comments to CSV before you delete.

= Built to be safe =

* Quarantine is the default action, and everything in it can be restored.
* Rules that could match every comment are refused.
* Comments by moderators and administrators are never touched. Add trusted email addresses or domains to the allowlist.
* Only real comments, pingbacks and trackbacks are managed. WooCommerce reviews and order notes are left alone.
* Confirmations show the exact number of comments before anything permanent happens.

= Privacy =

Ultimate Comment Cleaner does not connect to any external service, load remote scripts or fonts, or send any data away from your site. Everything it needs is stored in your own WordPress database and removed when you delete the plugin.

== Installation ==

1. Upload the `ultimate-comment-cleaner` folder to the `/wp-content/plugins/` directory, or install it from **Plugins → Add New**
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to **Tools → Ultimate Comment Cleaner**, open **Smart Rules** and click a ready-made rule to start

== Frequently Asked Questions ==

= How do I automatically remove spam comments in WordPress? =

Open **Tools → Ultimate Comment Cleaner → Smart Rules** and click a ready-made rule such as **Gambling spam** or **Russian / Cyrillic text**. Rules check every new comment as it arrives and also clean up existing comments hourly, daily or weekly, so removing spam comments needs no manual work. Caught comments go to a quarantine you can restore from.

= How do I remove unwanted comments from my site? =

Use **Manage Comments** to search and filter by text, name, email, website, IP, links or date, then select the comments and delete, mark as spam or quarantine them in bulk. For a one-off clean-up of many comments, use **Bulk Clean**. To keep unwanted comments away in future, add a Smart Rule.

= How do I stop Russian gambling spam comments in WordPress? =

Go to **Tools → Ultimate Comment Cleaner → Smart Rules** and click **Gambling spam** (keywords in English and Russian). Click **Test on existing comments** to see what it would catch, then **Save Rule**. For comments written in Russian generally, also add **Russian / Cyrillic text**.

= How do I block Chinese, Japanese or Korean spam comments? =

Use the **Chinese / Japanese / Korean text** ready-made rule, or create a rule and switch on the writing systems you want to catch. A rule flags a comment when at least the share of letters you set (30% by default) is in those alphabets.

= How do I delete all spam comments in WordPress? =

Open **Bulk Clean**, choose the **Spam** status, click **Preview Count**, then pick **Delete permanently** and apply. Large clean-ups run in batches with a progress counter, so they do not time out. You can also choose **Move to quarantine** to keep them restorable for a while.

= How do I bulk delete comments older than a certain date? =

In **Bulk Clean**, set the date range (or use **Only older than (days)** in a Smart Rule for a schedule), choose the statuses and post types, check the preview count and apply. Use **Export Selected** first if you want a CSV copy.

= Can I delete all comments on my site? =

Yes. In **Bulk Clean** leave the filters on "All Comments", preview the count, and choose to quarantine, mark as spam or delete them. This plugin cleans comments up. It does not turn commenting off, which you do under **Settings → Discussion**.

= What happens to a comment a rule catches? =

By default it is moved to quarantine: hidden from your site and from the normal comment screen, but kept so you can restore it. Choose "Mark as spam" or "Delete permanently" per rule if you prefer.

= Can a rule catch good comments by mistake? =

It can, which is why rules default to quarantine and have a test button. Restore a good comment from the Quarantine tab and it is never caught by your rules again. You can also add trusted email addresses or domains to the allowlist in Settings.

= Does it check new comments or only old ones? =

Both. Each rule can apply to new comments as they arrive, to existing comments on an hourly, daily or weekly schedule, or to both.

= How long do quarantined comments stay? =

14 days by default. Change it in **Settings**, or set 0 to keep them until you delete them.

= Does it work with Akismet or other anti-spam plugins? =

Yes. Comments Akismet already marks as spam are left to Akismet. Your rules add extra checks on top, such as keywords and writing systems.

= Does it slow down my site? =

New comments are checked once, when they are submitted. Scheduled clean-ups use the WordPress scheduler and work through your existing comments in small batches in the background.

= Does it send my comments to another service? =

No. All checks run on your own server and no data leaves your site.

= Where did my quarantined comments go if I deactivate the plugin? =

Quarantined comments stay hidden while the plugin is deactivated. Reactivate it to see them again. If you delete the plugin, they are handed back to WordPress as spam.

= I used Auto Triggers in version 1.0. What happened to them? =

They are imported as Smart Rules that delete exactly as before. A trigger that had no age limit (and so could have deleted every approved or pending comment) is imported switched off. Review it under Smart Rules.

= Can I preview how many comments will be affected? =

Yes. Bulk Clean has a "Preview Count" button, rules have a "Test on existing comments" button, and every confirmation shows the exact number.

= Can I export comments before deleting them? =

Yes. Use "Export Selected" or "Export All Comments" to download comments as a CSV file.

= What permissions are required? =

You need the `manage_options` capability (typically Administrator role) to use this plugin.

== Screenshots ==

1. Dashboard: comments stopped by your rules, spam share and trends for the last 7, 30 or 90 days.
2. Spam insights: when spam arrives, which writing systems, domains and words it uses.
3. Smart Rules: ready-made rules for Russian, gambling, Chinese, link and pharmacy spam.
4. The rule editor: keywords, writing systems, links and status, with a clear active switch.
5. Quarantine: see which rule caught each comment and why, then restore or delete it.
6. Manage Comments: search, filter and bulk-manage every comment, with spam signals under each one.
7. Bulk Clean: delete, quarantine or mark comments as spam in bulk, with filters and a preview count.

== Changelog ==

= 1.1.2 =
* Improvement: plugin name, description and tags now say what the plugin does: remove spam and unwanted comments, delete comments in bulk and automate removing comments
* Improvement: two new FAQ answers on removing spam and unwanted comments automatically

= 1.1.1 =
* Improvement: clearer plugin name, description and screenshots in the WordPress.org directory
* Improvement: new answers in the FAQ for deleting spam comments, blocking Russian or Chinese spam and bulk deleting by date

= 1.1.0 =
* New: Smart Rules - catch spam by keywords, writing system (Cyrillic, Chinese, Japanese, Korean and more), links, website and comment length, on new comments and on existing ones
* New: nine ready-made rules, including Russian/Cyrillic text and Gambling spam in English and Russian
* New: test any rule on your existing comments before using it, then review the matches in the comment list
* New: Quarantine - caught comments are hidden but restorable, and are deleted automatically after the number of days you set
* New: Manage Comments - search, filter, edit and bulk-manage all comments inside the plugin
* New: redesigned dashboard with trend charts, spam insights, rule accuracy and suggestions for the last 7, 30 or 90 days
* New: Bulk Clean can quarantine, mark as spam or delete, and can search by text
* New: allowlist of trusted email addresses and domains that rules never touch
* New: confirmations for permanent deletes in the comment lists
* Change: "Auto Triggers" are now Smart Rules; existing triggers are imported automatically
* Fix: Creating a new auto trigger no longer overwrites the previous one
* Fix: "Export Selected" now exports only the comments matching your filters, including word-count filters
* Fix: Activity logging and email notifications can now be turned off
* Fix: Scheduled rules no longer drift on sites with a non-UTC timezone
* Fix: Clicking outside the rule dialog now closes it
* Safety: Invalid or missing filters now match nothing instead of all comments
* Safety: Rules that would match every comment are refused
* Safety: Exported CSV cells are protected against spreadsheet formula injection
* Improvement: Bulk actions run in batches with a progress counter, so large clean-ups no longer time out
* Improvement: Confirmation shows the exact number of comments affected
* Improvement: Faster deletion (deferred comment counting, no site-wide cache flush)
* Improvement: Large exports are streamed in chunks to save memory
* Improvement: All interface messages are now translatable
* Improvement: Scheduled events are removed on deactivation; plugin data is removed on uninstall
* Requires WordPress 5.5 and PHP 7.4 or newer

= 1.0.0 =
* Initial release
* Dashboard with real-time statistics
* Bulk delete with multiple filter options
* Auto triggers system
* Export to CSV functionality
* Activity logging
* Modern, creative UI design
* Follows WordPress coding standards
* Proper comment cleanup using wp_delete_comment()
* Fixed issue where some comments were left behind after deletion

== Upgrade Notice ==

= 1.1.2 =
Updated plugin name, description and tags. No functional changes.

= 1.1.1 =
Updated plugin name, description and screenshots. No functional changes.

= 1.1.0 =
Big update: Smart Rules catch spam by keywords, language and links, with a restorable quarantine and a full comment manager. Fixes new triggers overwriting each other. Existing triggers are imported as rules.

= 1.0.0 =
Initial release of Ultimate Comment Cleaner. Install to start managing your comments efficiently!
