=== iSaor Comment Controls ===
Contributors: isaor
Tags: comments, disable comments, delete comments, spam comments, discussion
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn WordPress comments off everywhere or per post type, and safely bulk-delete existing comments, spam and old system logs.

== Description ==

**iSaor Comment Controls** gives you full control over comments on a WordPress site. Switch them off for the whole site or only for selected post types, and clean the database by deleting existing comments, spam, pingbacks or old system logs in bulk – even on sites with hundreds of thousands of entries.

The plugin is lightweight and private: no upsells, no tracking, no external requests and no CSS or JavaScript on the front end. It installs in **Off** mode, so activating it never changes a live site by surprise.

= Three simple modes =

* **Off** – nothing changes (default).
* **Selected post types** – on the post types you tick, new comments and pingbacks are closed, existing comments are hidden from visitors (not deleted), the Discussion panel and Comments column disappear from the editor, comment blocks render nothing and comment feeds return 404.
* **Everywhere** – all of the above for all content, plus site-wide removal of the Comments menu, Settings → Discussion, the admin-bar comments bubble, the Recent Comments dashboard box and widget, comment blocks in the block editor, the site comment feed, the X-Pingback header, XML-RPC comment and pingback methods, and public REST comment listings.

Switching back to **Off** restores everything. Hidden comments reappear because they were never deleted.

= Bulk delete comments =

* Delete **all comments**, **spam and trash only**, comments **by post type**, or **by comment type** (comment, review, pingback, trackback and more). Every option shows a live count.
* **System entries** – WooCommerce order notes, Action Scheduler logs, webhook delivery logs and block-editor notes – are kept by default and deleted only when you select them explicitly. Old Action Scheduler logs on shops often reach tens of thousands of rows.
* Large deletes run in steps of about 15 seconds with a progress bar, so 100,000+ entries finish without time-outs. If the browser is closed, press Delete again and it continues where it stopped.
* Comment meta is removed, replies of deleted comments move to the top level and comment counts are recalculated.

= WP-CLI =

    wp isaor-comments status
    wp isaor-comments disable --everywhere
    wp isaor-comments disable --post-types=post,page
    wp isaor-comments enable
    wp isaor-comments delete --all --yes
    wp isaor-comments delete --spam
    wp isaor-comments delete --post-types=product
    wp isaor-comments delete --comment-types=pingback,trackback
    wp isaor-comments delete --all --include-system --yes

= For developers =

* Settings: one option, `isaor_dc_settings`.
* Filter `isaor_dc_protected_comment_types` – comment types treated as system entries.
* Filters `isaor_dc_step_seconds` (default 15) and `isaor_dc_batch_size` – lower them on hosts that cut long requests short.
* Action `isaor_dc_comments_deleted` – fires after each delete step with `$deleted`, `$scope`, `$items`.

= Privacy =

The plugin does not collect data, use cookies or connect to external services.

== Installation ==

1. In WordPress go to **Plugins → Add New**, search for “iSaor Comment Controls”, install and activate it. Or upload the `isaor-comment-controls` folder to `/wp-content/plugins/` and activate it.
2. Go to **iSaor Core → Comment Controls**.
3. Choose a mode on the Settings tab and save, or use the Delete comments tab to clean up existing comments.

== Frequently Asked Questions ==

= Does activating the plugin change my site? =

No. The plugin starts in Off mode. Nothing changes until you choose a mode and save.

= Are hidden comments deleted? =

No. Disabling only hides existing comments. They come back when you switch to Off. Only the Delete comments tab removes comments.

= Can deleted comments be restored? =

No, deletion is permanent. Take a database backup before a bulk delete.

= Will it delete my WooCommerce order notes? =

Not unless you select them explicitly as system entries. They are excluded from “All comments” by default.

= Does it work with the block editor Notes feature? =

Yes. The REST comments route stays available for editor Notes; visitors get an empty list and new comments are refused.

= Does it work on multisite? =

Yes, per site. There is no network-wide setting yet.

= What happens when I uninstall the plugin? =

The plugin's settings are removed. Comments are never touched on uninstall.

== Changelog ==

= 1.2.0 =
* System entries (WooCommerce order notes, Action Scheduler logs) can be deleted when selected explicitly.
* Large deletes run in 15-second steps with a progress bar.
* WP-CLI: progress bar and --include-system option.

= 1.1.0 =
* Documentation tab.

= 1.0.0 =
* First release.
