As many wordpress users known, the comment off tag always be showed once you close the comment function. Many users would like to turn off the comment of the wordpress after an given days of the post release. It can be archived via the section DISCUSSION of the wordpress admin. So how can we remove the boring words Comment Off. There are three ways as following.
- Modified the function comments_popup_link in the template file of the comment
- Find the file named comment-template.php located at wp-icludes. There has the words “Comment Off’ as the value of the variable $none (in the comments_popup_link). – tip credits
- The disadvantage of the way: we need to modify the code once we decide to update the wordpress to newer. It’s one of methods to keep safely. Please always update your blog to the newest wordpress version. On the other hands, it will remove the empty HTML tag in your page. It doesn’t help the in-page SEO.
- In fact, we change the default value of the last parameters of the function comments_popup_link. So, we can just set its value to instead of the modification of the default value.
- Change your theme files – three places
- Open index.php and remove this:
<span class="add_comment"> - Open single.php and remove this:
<?php comments_template(); ?> - Open archive.php and remove this:
<?php comments_popup_link('No Comments', '1 Comment', '% Comments');?> - The second tip is taken from the blog wphackr.com. Compared with the first one, you shouldn't modify the code any more once you have remove those lines. However the wordpress lost the comments tag on all pages for ever:)
Jonrichards_net, one of the members of wordpress forum has mentioned the file comments.php as well as.
Recent Comments