WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#11691 closed enhancement (wontfix)

Tag cloud widget: Add support for nofollow

Reported by: trick77 Owned by: azaozz
Milestone: Priority: normal
Severity: minor Version:
Component: Widgets Keywords: has-patch
Focuses: Cc:

Description

Please add support for nofollow tag for the tag cloud widget. It would be nice to have a checkbox in the widget configuration area that controls if the tag cloud should or should not use the nofollow tag in the generated links.

Attachments (4)

default-widgets.php (38.1 KB) - added by trick77 8 years ago.
Enhanced tag cloud widget with configurable nofollow support
category-template.php (30.2 KB) - added by trick77 8 years ago.
Enhanced tag cloud function with nofollow tag support
nofollow_tag_cloud_widget.png (10.2 KB) - added by trick77 8 years ago.
11691.diff (3.7 KB) - added by trick77 8 years ago.
Enhanced tag cloud with nofollow tag support

Download all attachments as: .zip

Change History (18)

#1 @trick77
8 years ago

  • Cc trick77 added
  • Keywords tag cloud removed

@trick77
8 years ago

Enhanced tag cloud widget with configurable nofollow support

@trick77
8 years ago

Enhanced tag cloud function with nofollow tag support

#2 @trick77
8 years ago

I just uploaded the changes. I guess I will have to provide .diff files through the SVN though.

@trick77
8 years ago

Enhanced tag cloud with nofollow tag support

#3 @trick77
8 years ago

  • Keywords has-patch added

#4 @nacin
8 years ago

-1 to this.

User reasons: Like the rest of core, the default widgets should have as few unnecessary options as possible. I don't think this option would or should be used enough (more on that in a moment) to be in core.

Additionally, many bloggers will not know what nofollow is, simple as that. Nor should they need to learn it to decide whether their internal tag cloud should have nofollow links.

SEO reasons: Unless I am missing something, adding nofollow to internal site links doesn't make much sense anyway. To elaborate, Google has changed how nofollow links are used to calculate pagerank.

Passing more pagerank to other links on the page is the only reason I can think of as to why you'd want to do this. Previously, if you had 10 links with 5 nofollow, the other five links each got 20%. But now, the other five links each get 10% -- the nofollow links are counted, but the pagerank they would pass is not passed.

This is something that should be left as a plugin. You can use wp_rel_nofollow() on the widget HTML which will add nofollow to all links.

Suggesting wontfix.

#5 @trick77
8 years ago

According to Matt Cutts (but mind you, there are other search engines as well which may handle things differently):
"The nofollow attribute is just a mechanism that gives webmasters the ability to modify PageRank flow at link-level granularity. Plenty of other mechanisms would also work (e.g. a link through a page that is robot.txt'ed out), but nofollow on individual links is simpler for some folks to use. There's no stigma to using nofollow, even on your own internal links; for Google, nofollow'ed links are dropped out of our link graph; we don't even use such links for discovery. By the way, the nofollow meta tag does that same thing, but at a page level."

So, if you guys don't wont this to be configurable, then why don't we put nofollow in the tag cloud as the default, without an option in the widget. There's no point of internally link spamming your own blog at all. That would be a small one-line patch after all.

#6 @trick77
8 years ago

  • Component changed from General to Widgets
  • Owner set to azaozz

#7 @filosofo
8 years ago

I've seen a good amount of anecdotal evidence that suggests tag links improve SEO. Why would you want to nofollow them?

#8 follow-up: @trick77
8 years ago

Btw, by looking at the original cloud tag function code I don't see a way there setting wp_rel_nofollow() should lead to nofollowed links. There's no such code called when the link is being generated.

filosofo: I don't think so, just have a look how PR is calculated. Having fewer non-essential internal links automatically inherits more page rank to essentially linked posts and in general, this is what everyone wants.

#9 in reply to: ↑ 8 @nacin
8 years ago

Replying to trick77:

Btw, by looking at the original cloud tag function code I don't see a way there setting wp_rel_nofollow() should lead to nofollowed links. There's no such code called when the link is being generated.

You would use the plugin API to add a filter.

filosofo: I don't think so, just have a look how PR is calculated. Having fewer non-essential internal links automatically inherits more page rank to essentially linked posts and in general, this is what everyone wants.

That's not true anymore, I explained that above.

#10 follow-up: @trick77
8 years ago

Nevermind... I won't discuss SEO with you.

I tried your suggestion with the API filter using
add_filter('wp_generate_tag_cloud', 'wp_rel_nofollow');
but that just leaves me with a destroyed tag cloud because the function inserts backslashes everywhere.

#11 in reply to: ↑ 10 @nacin
8 years ago

Replying to trick77:

Nevermind... I won't discuss SEO with you.

Well, for reference, here is Matt Cutts on sculpting: http://www.mattcutts.com/blog/pagerank-sculpting/

I tried your suggestion with the API filter using
add_filter('wp_generate_tag_cloud', 'wp_rel_nofollow');
but that just leaves me with a destroyed tag cloud because the function inserts backslashes everywhere.

Sorry, wp_rel_nofollow() is for the pre_comment_content filter, so it escapes in preparation for the comment to be inserted into the db. You'd need to use this, which steals a line from wp_rel_nofollow() and uses its helper callback:

add_filter( 'wp_generate_tag_cloud', 'my_nofollow_tag_cloud_example' );
function my_nofollow_tag_cloud_example( $text ) {
   return preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
}

Again, I feel this doesn't belong in core for various reasons mentioned above.

#12 @trick77
8 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Thanks nacin. We both agree that nofollow is something that the common user should not have to worry about. Ticket can be closed.

#13 @jdingman
8 years ago

If you're really concerned about nofollow, look at the plugin called "add_link_attr" -- it will do exactly what you want and there are no core code changes for it.

#14 @sirzooro
8 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.