Remove Comment Off Tag

WordPress No Comments

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.

Google Bots Loves WordPress Really

Google, WordPress No Comments

Even without any links, Google bots still get the pagings of WordPress main page. And it has been indexed. I have to add noinex tag to those page!:)

Disable the Sociable on WordPress Pagings – blogplay

WordPress 1 Comment

I have met an issue with the Sociable at one of my sites which uses static page as front page. The social tool shows on the all pagings of WordPress main page(such as example.com/page/1/, example.com/page/2/,…)

So I have to modified the source code (sociable.php in the plugin folder). It is simple! Just insert the blue lines into the function sociable_html.

function sociable_html($display=array()) {
global $sociable_known_sites, $sociablepluginpath, $wp_query, $post;

if (get_post_meta($post->ID,'_sociableoff',true)) {
return "";
}
if (is_paged()) {
return "";
}

However, it seems it can’t fix the page one as the wordpress function is_paged() just count from 2nd paged page.

A Paged Page

is_paged()
When the page being displayed is “paged”. This refers to an archive or the main page being split up over several pages and will return true on 2nd and subsequent pages of posts. This does not refer to a Post or Page whose content has been divided into pages using the <!–nextpage–> QuickTag.

It’s reasonable, as the first paged page usually the same as home page or main archived page:) Anyway, I have to find a new methods to prevent the sociable on paged page. Just replace the three blue lines at above to or added the following behind them.

if (preg_match('/\/page\/\d+(\/)?$/i',$_SERVER['REQUEST_URI'])!==0) {
return "";
}

@ 2009 - GGIN.Com