Acest modul nu a fost testat cu ultimele 3 versiuni importante ale WordPress. S-ar putea să nu mai fie întreținut sau susținut și ar putea avea probleme de compatibilitate când este folosit cu versiuni recente ale WordPress.

One Click Close Comments


From the admin listing of posts (‘Edit Posts’) and pages (‘Edit Pages’), a user can close or open comments to any posts to which they have sufficient privileges to make such changes (essentially admins and post authors for their own posts). This is done via an AJAX-powered color-coded indicator. The color-coding gives instant feedback on the current status of the post for comments: green means the post/page is open to comments, red means the post/page is closed to comments. Being AJAX-powered means that the change is submitted in the background after being clicked without requiring a page reload.

Modulul va funcționa doar pentru utilizatorii din administrare care au JavaScript activat.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage


Modulul expune un filtru pentru agățătoare. Un astfel de cod ar trebui, în mod ideal, să fie pus într-un modul folosit obligatoriu sau într-un modul specific site-ului (lucru care depășește obiectul acestui fișier readme de a explica).

c2c_one_click_close_comments_click_char (filter)

The ‘c2c_one_click_close_comments_click_char’ hook allows you to use an alternative character, string, or markup as the plugin’s indicator in the posts listing tables. It is the character that gets color-coded to indicate if comments are open or close, and the thing to click to toggle the comment open status. You can make use of Dashicons by specifying the desired dashicon’s name (with the „dashicons-” prefix). By default this is the comments dashicon, dashicons-admin-comments.


  • $char (array): The character, string, or markup to be used for display (by default this is dashicons-admin-comments).


 * Changes the character used as the one-click link to a bullet (solid circle).
 * @param string $char The default character.
 * @return string
function custom_one_click_char( $char ) {
    return '•';
add_filter( 'c2c_one_click_close_comments_click_char', 'custom_one_click_char' );

Capturi ecran

  • A screenshot of the ‘Posts’ admin page with the plugin activated. The tooltip (from hovering over a green indicator) reads: „Comments are open. Click to close.” Were the mouse to hover over a red indicator, the tooltip would read: „Comments are closed. Click to open.”


  1. Instalează prin instalatorul nativ pentru module al WordPress sau descarcă și dezarhivează în directorul cu module pentru site-ul tău (de obicei în wp-content/plugins/)
  2. Activează modulul din meniul de administrare „Module” în WordPress
  3. Când ești în paginile de administrare „Editare articole” sau „Editare pagini”, dă clic pe indicatoare pentru a comuta starea comentariilor pentru un articol, dacă este necesar.

Întrebări frecvente

Pot vedea baloanele colorate pentru comentarii care indică starea actuală a comentariilor, dar de ce nu pot da clic pe ele?

Pe legătura/butonul stare comentarii se poate da clic numai dacă ai JavaScript activat.

What does the color-coding of the comment bubble mean?

Verde înseamnă că articolul este deschis acum pentru comentarii; roșu înseamnă că articolul nu este deschis acum pentru comentarii.

How can I customize the color-coding used for the comment bubble?

Poți personaliza culorile via CSS. .comment-state-1 indică comentariile sunt deschise. .comment-state-0 indică comentariile sunt închise.

Cum pot personaliza caracterul folosit pentru a reprezenta starea comentariilor?

By default, commenting status is represented using the comment bubble dashicon, dashicons-admin-comments. You can change this by filtering c2c_one_click_close_comments_click_char. Here’s an example – added to a theme’s functions.php file – to change it to the original bullet (solid circle) character:

add_filter( 'c2c_one_click_close_comments_click_char', function ( $a ) { return "•"; } );

How can I open or close comments when editing a specific post?

WordPress already includes the interface for you to edit the comment status for a specific post. When editing a post, you’ll find the setting in the „Discussion” section; the checkbox is labeled „Allow Comments”.

Why does the comment status indicator indicate that comments are open, when in reality comments are disabled (or vice vera)?

The comment status indicator only reflects the value of the „Allow Comments” setting for the post. In most cases, the indicator will accurately reflect the ability for the user to see the comment form and/or submit a comment.

However, other plugins, the theme, or custom code may affect the visitor’s ability to see the comment form when viewing a post and/or may permit or disable commenting at the time the post is shown to them despite the value of the setting. For instance, you could have another plugin installed which disables comments for a post after one year. After a year, that plugin would disable comments in its own way, but the comment status indicator for the post could reflect that comments are open since technically the post’s „Allow Comments” setting would still be enabled.


2 aprilie 2023
As simple as this plugin is it solves a BIG problem for me! I needed something that would close and open comments on posts based on the author role but doing it manually works just fine. Thanks!
19 iunie 2018
Excellent plugin. Used it for many years without a problem. It is a pity that it is not updated anymore.
3 septembrie 2016
However the dot is green even though the comments were automatically closed. Why? Error or feature? 🙂
Citește toate cele 10 recenzii

Contributori și dezvoltatori

„One Click Close Comments” este un software open-source. La acest modul au contribuit următoarele persoane.


„One Click Close Comments” a fost tradus în 4 locale. Mulțumim traducătorilor pentru contribuția lor.

Tradu „One Click Close Comments” în limba ta.

Te interesează dezvoltarea?

Răsfoiește codul, vezi depozitarul SVN, sau abonează-te la jurnalul de dezvoltare prin RSS.

Istoric modificări

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)


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


  • 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 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 to be HTTPS

2.6.1 (2019-11-24)

  • New: Add additional FAQ items
  • Change: Note compatibility through WP 5.3+
  • Change: Update copyright date (2020)

Full changelog is available in