On posts where comments are closed, the plugin will remove the text 'Comments are closed.' The plugin supports any languages/text domains, and will remove the text from themes and plugins.

Prerequisite: Since the plugin is filtering gettext, your theme/plugin must be localized.

The plugin is available in the WordPress plugin directory


Plugin source code:

<br />
&lt;?php<br />
/*<br />
Plugin Name: Remove &quot;Comments are closed&quot;<br />
Plugin URI: http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/<br />
Description: On posts where comments are closed, the plugin will remove the text 'Comments are closed.' The plugin supports any languages/text domains, and will remove the text from themes and plugins.<br />
Author: Per Soderlind<br />
Version: 1.2<br />
Author URI: http://soderlind.no/<br />
*/</p>
<p>add_filter('gettext', 'ps_remove_comments_are_closed', 20, 3);</p>
<p>function ps_remove_comments_are_closed($translated_text, $untranslated_text, $domain) {<br />
    if ( $untranslated_text == 'Comments are closed.' ) {<br />
        return '';<br />
    }<br />
    return $translated_text;<br />
}<br />
?&gt;<br />

Changelog:

  • 1.2 removed unnecessary code
  • 1.1 initial public release