Skip to main content
Black Friday Get 50% extra hosting credits. Pay $99, get $150. 50% extra credits 50% extra credits 1d 5h left Get $150 for $99Get it
One Click Close Comments icon

One Click Close Comments

v3.0
by Scott Reilly · 4.9 (10 reviews)

Conveniently close or open comments for a post or page with one click from the admin listing of posts.

5K+ active installs Updated Apr 17, 2025 Tested to 6.8.13
Try Demo Download
Pre-installed Ready in ~10s No card

About One Click Close Comments

The One Click Close Comments plugin allows admins and post authors to easily open or close comments on posts and pages from the admin listing. The plugin uses a color-coded indicator to show the current comment status, and the change is submitted in the background without requiring a page reload. It is important to note that this plugin is only available for admin users with JavaScript enabled.

Screenshots

One Click Close Comments screenshot

Frequently asked questions

What is the purpose of the One Click Close Comments plugin?
The purpose of the One Click Close Comments plugin is to allow users with sufficient privileges to close or open comments on posts and pages in the WordPress admin area. This can be done via an AJAX-powered color-coded indicator.
Who can use the One Click Close Comments plugin?
The One Click Close Comments plugin can only be used by administrative users in the WordPress admin area who have JavaScript enabled.
Where can I find more information about the One Click Close Comments plugin?
You can find more information about the One Click Close Comments plugin on the following links: Plugin Homepage, Plugin Directory Page, GitHub, and Author Homepage.
Are there any hooks available for the One Click Close Comments plugin?
Yes, the One Click Close Comments plugin exposes one filter for hooking. The filter is called 'c2c_one_click_close_comments_click_char' and it allows you to use an alternative character, string, or markup as the plugin's indicator in the posts listing tables.
Can you provide an example of how to use the 'c2c_one_click_close_comments_click_char' hook?
Here is an example of how to use the 'c2c_one_click_close_comments_click_char' hook to change the character used as the one-click link to a bullet (solid circle):nn```phpn/**n * Changes the character used as the one-click link to a bullet (solid circle).n *n * @param string $char The default character.n * @return stringn */nfunction custom_one_click_char( $char ) {nreturn '•';n}nadd_filter( 'c2c_one_click_close_comments_click_char', 'custom_one_click_char' );n```

Changelog

3.0 (2025-04-17)

Highlights:

This long-awaited major release improves accessibility by allowing keyboard navigation and interaction, reimplements JS to only use vanilla JS, properly shows (or doesn’t show) mouse cursor as pointer when hovering over comment status toggle, notes compatibility through WP 6.8+, and more.

Details:

  • Change: Improve accessibility
    • Change: Use a semantic button instead of a span
    • New: Allow comment state buttons to be navigable by keyboard
    • New: Allow keyboard control by having the spacebar toggle comment state when toggle is focused
  • Change: Reimplement JavaScript to use vanilla JS and discontinue use of jQuery
  • Change: Prevent UI cues indicating comment status might be changeable to users who cannot change them (they never could)
    • Change: Prevent cursor from changing to pointer when comment status cannot be changed
    • Change: Prevent asynchronous JS submission of request to toggle comment status
  • Change: Prevent display and use of comment status indicator for post types that don’t support comments
  • Change: Improve nonce handling
    • Change: Generate a unique nonce per post rather than a generic nonce
    • Change: Store nonce in ‘data-nonce’ attribute rather than ‘id’
    • Change: Use unused private static class variable ‘nonce_field’ as base for nonce field key and value
  • Change: Use result of update to recognize if the comment status didn’t get changed for some reason
  • Change: Ensure AJAX response is only ever an integer
  • Change: Remove any markup potentially introduced in a string translation
  • Fix: Restore changing mouse cursor to a pointer on hover
  • Change: Assign additional generic class of ‘comment_state’ to indicator markup
  • Change: Reset field_title variable in reset() and use reset() during initialization
  • Change: Use update() rather than query() for making SQL update request
  • New: Add inline documentation to class variables
  • New: Add recommendation for Add Admin CSS plugin for adding the CSS suggested in FAQ entry related to customizing indicator
  • New: Add DEVELOPER-DOCS.md and move hooks documentation into it
  • Change: Discontinue unnecessary explicit loading of textdomain
  • Change: Prevent unwarranted PHPCS complaints
  • Change: Tweak some text in the FAQ section, including fixing a typo
  • Change: Note compatibility through WP 6.8+
  • Change: Update copyright date (2025)
  • Change: Note compatibility through PHP 8.3+
  • Change: Tweak installation instruction
  • Change: Reduce number of ‘Tags’ in readme.txt
  • Change: Remove development and testing related files from release packaging
  • Unit tests:
    • Fix: Allow tests to run against current versions of WordPress
    • Hardening: Prevent direct web access to bootstrap.php
    • Change: Restructure unit test directories
      • Change: Move bin/ into tests/
      • Change: Move tests/bootstrap.php into tests/phpunit/
      • Change: Move tests/test-one-click-close-comments.php into tests/phpunit/tests/
    • Change: Remove ‘test-‘ prefix from unit test files
    • Change: In bootstrap, store path to plugin file constant
    • Change: In bootstrap, add backcompat for PHPUnit pre-v6.0
    • Change: Rename phpunit.xml to phpunit.xml.dist per best practices
    • New: Add composer.json for PHPUnit Polyfill dependency
    • Change: Explicitly define return type for overridden methods
  • New: Add a few more possible TODO items

2.7.1 (2021-04-01)

  • New: Add a unit test
  • Change: Note compatibility through WP 5.7+
  • Change: Update copyright date (2021)

2.7 (2020-08-02)

Highlights:

  • This recommended release updates its JavaScript, streamlines markup output, adds unit testing, adds a TODO.md file, updates a few URLs to be HTTPS, notes compatibility through 5.4+, and other minor behind-the-scenes improvements.

Details:

  • New: Extract code for determining click character into new get_click_char()
  • New: Add unit tests
  • New: Add reset() for resetting memoized variables
  • New: Add TODO.md and move existing TODO list from top of main plugin file into it (and add items to it)
  • Change: Improve output of markup
    • Remove encompassing span only shown for users authorized to toggle comment status
    • Add ‘title’ attribute to primary span to indicate current state
    • Change text to not indicate that comment staus can be toggled when user does not have that capability
  • Change: Update JavaScript
    • Change: Migrate use of deprecated .live() to .on()
    • Change: Handle removal of a previously encapsulating span
    • Change: Remove unused code
    • Change: Update code syntax
  • Change: Allow class to be defined even when loaded outside the admin
  • Change: Return ‘-1’ to Ajax requests that don’t result in the comment status being toggled
  • Change: Add $and_exit argument to toggle_comment_status() to prevent exiting in order to facilitate unit testing
  • Change: Refactor add_post_column() to be more concise
  • Change: Add inline docs for deprecated filter one-click-close-comments-click-char
  • Change: Switch to use of strict equality operator instead of simple equality operator
  • Change: Note compatibility through WP 5.4+
  • Change: Update links to coffee2code.com to be HTTPS

Full changelog is available in CHANGELOG.md.

Try other plugins

One Click Demo Import icon

One Click Demo Import

4.3 · 1M+ installs

Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo import…

Header Footer Code Manager icon

Header Footer Code Manager

4.9 · 600K+ installs

Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for analytics, marketing,…

$750 of hosting credits for $499.Black Friday