How to Limit Number of Tags & Add NoFollow Attribute on WordPress

fop_archer

Make Money Online
Joined
Aug 9, 2009
Messages
663
Reaction score
32
Points
27
Age
34
Location
MMD
Accordingly a recent video from Google Webmaster Central Channel on YouTube, Matt Cutts, the head of Google webspam team, has pointed out that in replying a reader’s question – “Do tag clouds help or hinder SEO?†too many tags on the blog page can result in keyword ******** that makes Google or other search engines consider the links as spam/less trusted links, and Matt does not recommend bloggers to use tag clouds.

The biggest problem with tag clouds:
the tag phrases are often single words – for example Google, or SEO, and as such are unlikely to be able to be ranked on Google for those phrases. Better to be longer phrases;
the tag pages are seldom SEO’ed properly. You need to create an opening paragraph on the pages specifically for that “tag†phrase.

You might view this video below,


I would suggest to remove tag clouds simply as what Matt Cutts said. Anyway, you can still have two solutions for SEO your WordPress tag clouds. Limit the numbers of tags and adding nofollow attribute for tag clouds.
Limit Numbers of Tags

The default limitation of tags is 45, you can change the number as you desire. First open category-template.php under wp-includes folder, and find this code,

PHP:
function wp_tag_cloud( $args = '' ) {
$defaults = array(
'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'number' => 45,
'format' => 'flat', 'separator' => "\n", 'orderby' => 'name', 'order' => 'ASC',
 'exclude' => '', 'include' => '', 'link' => 'view', 'taxonomy' => 'post_tag', 'echo' => true
	    );
Then change the 45 to equal the desired number of tags.

Add NoFollow Attribute for Tag Clouds

Another solution is adding rel=â€nofollow†no-follow attribute for each tag in tags cloud. WordPress by default doesn’t have “no-follow†attribute added to the tag cloud. You need to open wp-config.php in root directory and then add the following codes,

PHP:
1	add_filter( ‘wp_generate_tag_cloud’, ‘my_nofollow_tag_cloud_example’ );
2	function my_nofollow_tag_cloud_example( $text ) {
3	return preg_replace_callback(‘|<a>|i’, ‘wp_rel_nofollow_callback’, $text);</a></code>

<code><a>function add_nofollow_tag($sLink) {
2	    return str_replace('</a><a href=", "></a><a rel="nofollow" href=", $sLink);&lt;br &gt;&lt;/a&gt; 3	}&lt;br /&gt; 4	add_filter("></a>
WordPress No Follow Tag Clouds Plugin

SmartBlogTips has a handy plugin that add no-follow attributes automatically to tag clouds, you are not necessary to do it manually. Check out the WordPress No Follow Tag Clouds pluginhere:

Code:
http://smartblogtips.com/how-to-add-nofollow-attribute-to-tag-cloud-in-wordpress/
 
Last edited by a moderator:

Griffon

Weiter Weiter
Joined
Mar 29, 2010
Messages
979
Reaction score
9
Points
17
Location
teh interwebz
That could be counted as spam if you have a relly big blog, with hundreds of posts, and each one has different tags. Then you end up with thousands of keywords tags.. and if you ask me, I'd say that would look more spammy to the human readers than to search engine spiders.

I usually avoid listing tags on home page, since I usually try to make my websites "unique" in a way that they don't like regular blogs.. plus G usually indexes these tag pages anyway, so it all adds up to your "indexed pages score".. and it wouldn't hurt your overall SEO process
 

Nfark

Make Money Online
Joined
Apr 27, 2010
Messages
55
Reaction score
0
Points
0
Age
32
Oh well, thanks man I was about to use tag clouds and so...
This saved me!