WordPress.org

Forums

Nofollow Plugin for WordPress 1.2 (37 posts)

  1. clintology
    Member
    Posted 10 years ago #

    I whipped this up pretty quick using the filter code from Six Apart's rel=nofollow spam catching plugin.

    Here's the link to the plugin: http://www.phaedo.cx/includes/wpNofollow.php.zip

    The source: http://phaedo.cx/includes/wpNofollow.phps

    It basically just filters anchor tags and adds in the rel=nofollow attribute. Google, MSN, and Yahoo! all announced support today for this tag. You can read more about it here: http://phaedo.cx/archives/2005/01/18/support-for-nofollow/ there are links to everyone's announcements.

    The comment text filtering is automatic, but if you want comment_author_link to return a link with the attribute in it, you need to replace the call to that function in wp-comments.php with the function in my script named comment_author_link_nofollow().

    this is my first plugin for WP and I'm sure I've not done everything 100% correct, so please feel free to comment and criticize, I can take it :)

  2. clintology
    Member
    Posted 10 years ago #

    Here's MT's announcement of their plugin: http://www.movabletype.org/news/2005/01/movable_type_nofollow_p.shtml

    I'm sure this will be supported natively in a future point release of 1.2 and definately in 1.5?

    This might be a more consise description on how to use my plugin: http://phaedo.cx/archives/2005/01/18/wp-nofollow/

    :)

  3. NuclearMoose
    Member
    Posted 10 years ago #

    Cool...but I see an issue here. This rel=nofollow punishes legitimate commenters IF ALL LINKS are given the nofollow attribute. I don't mind it when Podz comes to my site, posts comments, and of course, leaves the URL to his site. I want the various services to know that Podz's site is a site worth ranking.

    So, how do we filter out the spam crap and keep promoting those good sites?

    EDIT: Also, if you have some quality spam blocking tools in use, then in theory, these links won't make it to live status on your blog.

  4. gregorsmith
    Member
    Posted 10 years ago #

    As Shelley said, this is 3 years too late, and what happenes when people use this attribute for "evil" purposes?

    Too many questions already

  5. NuclearMoose
    Member
    Posted 10 years ago #

    It's the search engines that created the ranking hysteria, and it's the common blogger and webmaster that has paid the price. Three years too late, indeed.

  6. Swirlee
    Member
    Posted 10 years ago #

    clintology, I wish I'd seen your plugin earlier before I started (and nearly finished) writing my own. Anyway, good work.

    gregorsmith, I can't imagine any way this could be used for "evil" purposes. The nofollow attribute doesn't punish the sites linked to or reduce their pagerank; it only prevents their pagerank from being increased by that link.

    And NuclearMoose, if you want to increase somebody's pagerank, link to their site in your blog. It's good karma, anyway. :)

    Edit: clintology: one small bug; it doesn't appear to work on URLs that have automatically been hyperlinked by WP's make_clickable() function. I believe adjusting the filter's priority will fix this.

  7. NuclearMoose
    Member
    Posted 10 years ago #

    Swirlee...
    Allowing a visitor to put a link on my site is the same as putting a link on myself, is it not? It's a link from my site, regardless.

  8. Swirlee
    Member
    Posted 10 years ago #

    Allowing a visitor to put a link on my site is the same as putting a link on myself, is it not? It's a link from my site, regardless.

    Well, now that we have the rel="nofollow" attribute, that is only the case if you want it to be. I would rather be able to set links that I actively endorse (e.g. in blog posts and in my blogroll) apart from links that everybody else, including spammers, have put on my site.

    I've read a number of opinions along the lines of "well this is irrelevant if you have a decent anti-spam system installed". It's half-right: if every blogger (and forum/guestbook/wiki/etc. administrator) had a decent anti-spam system installed, this would be irrelevant. But the fact is the vast majority don't, and that means comment spam continues everywhere else, PageRank gets polluted, and my search results get worse. rel="nofollow" is worth implementing because if the major blog software publishers and services all implement it (and Google says the big ones already are, including Matt) then the entire inscentive behind comment spam disappears.

  9. NuclearMoose
    Member
    Posted 10 years ago #

    [Self-moderated]

    This is getting off-topic to the thread. Any continuation will result in all off-topic posts being deleted.

  10. Swirlee
    Member
    Posted 10 years ago #

    Well, let's examine this very group of people you're talking about. People who don't know how to manage the technical details of their site? People who don't care about or know how to solve comment spam? I'd say that 95% of these people are using Blogger, LiveJournal, and SixApart's TypePad. Those people will be following (no pun intended) the nofollow initiative whether they like it or not. Most of them won't even notice.

    The other 5%? Well, it's hardly worth mentioning, but it's comprised of a couple of small groups:

    1. People in hosted scenarios where their blog software was installed for them. Most hosting companies which install software for customers are security-conscious and keep such software current, so most of these folks will join the nofollow bandwagon and might not even notice.
    2. Folks who installed blog software themselves. Many of these people will upgrade their software sooner or later (especially MT users who are paying for the privilege). Some won't, but do you suppose they'll make a dent?
    3. People with old, abandoned blogs. Spam comments accumulate on these old sites. Fortunately for us, sites like this have next to no PageRank, so our search results aren't affected much anyway.

    So, which users am I missing?

    (Oh, I suppose this will get deleted. Egh. And I felt so good about it.)

  11. PantherMachina
    Member
    Posted 10 years ago #

    I'm of the opinion that this is a nice feature to have, but not something that should be on by default. My site has yet to ever have a spam comment go live and they all sit in moderation till I hit delete.

    However the people that read my blog and post to it are doing me a service by commenting, so why would I not give them something in return like a link back and free rank boost?

    When I post on other people's blogs I'm not creating spam, I'm posting my viewpoint to be shared with people, and if people like it they click through for other things that I've said on other subjects. If all goes well, then the incestous blog community works and my blog gets more popular while the people whose blogs I comment on also get more popular, everybody wins and when I search for my name, I get ranked higher.

    Again, there is nothing wrong with this, but rather than punish everyone indiscriminately why not instead allow users to choose to let thier commenters get some google love?

  12. soulcore
    Member
    Posted 10 years ago #

    works fine in wordpress 1.5
    http://www.soulcore.de

  13. nicokaiser
    Member
    Posted 10 years ago #

    It gives me

    Warning: Wrong parameter count for preg_grep() in /srv/www/siriux.net/html-data/wp-content/plugins/wpNofollow.php on line 29

    Warning: Bad arguments to join() in /srv/www/siriux.net/html-data/wp-content/plugins/wpNofollow.php on line 30

    Did not have the time to look into its code, but maybe someone has a patch already?

  14. nicokaiser
    Member
    Posted 10 years ago #

    It's the PREG_GREP_INVERT parameter for preg_grep. It needs PHP >= 4.2.0. I'll have a look at its logic later to patch the plugin to be PHP 4.1 compatible.

  15. clintology
    Member
    Posted 10 years ago #

    I'm not sure how this plugin would be modified to allow for selective application of the attribute. Anyone have any ideas?

  16. orangeguru
    Member
    Posted 10 years ago #

    1. Excellent plugin

    2. Excellent idea that Google, Yahoo, MT etc. support the new tag

    3. Bloggers have polluted search engines for to long, not every link comment is so important to be spidered and considered for page ranking

  17. orangeguru
    Member
    Posted 10 years ago #

    @clintology:

    If I enter a link in the comment WITHOUT the a href etc. the plugin won't bite.

    Here i just write in a normal link:

    http://www.orangeguru.net/weblog/

    And I get this in the source/comment

    <p><a href='http://www.orangeguru.net/weblog/'>http://www.orangeguru.net/weblog/</a></p>

    When I use the proper html syntax:

    <a href="http://www.orangeguru.net/weblog/">My Weblog</a>

    Then the plugin works (source/comment):

    <p><a href="http://www.orangeguru.net/weblog/" rel="nofollow">My Weblog</a>

  18. dissurion
    Member
    Posted 10 years ago #

    The funy thing is, if you want to apply it selectively automatically, you have to have a decent working spam detection. And if you have that, you don't need the attribute anymore.

  19. dissurion
    Member
    Posted 10 years ago #

    One more thing:

    I like the way livejournal is implementing it. A comment from someone on your friends list will not have the nofollow, but if they are not on your friends list it will have the nofollow. (quoted from http://www.webmasterworld.com/forum5/6053.htm)

  20. Anonymous
    Member
    Posted 10 years ago #

    That is a nice idea. It would be great if WP could incorporate a similar 'whitelist' check; that is, if the URL is included in your Links Manager the 'no-follow' isn't added. That would do away with bloggers whining that their Page Rank isn't going to be increased by posting on other blogs; though IMO posting comments with that in mind is only one step above spamming anyway.

  21. idban
    Member
    Posted 10 years ago #

    for spoiler hack user please apply patch (follow instruction on my site) to make this plugin work.

    http://secandri.com/blog/2005/01/19/nofollow-plugin-for-wordpress-12/

  22. VesperDEM
    Member
    Posted 10 years ago #

    I have to agree with orangeguru here. I just tested it and it worked great for 'a' links, but WordPress takes url's and converts them into links. The converted links don't have the rel='nofollow' tag in it.

    Any chance this plug-in will get updated to handle those?

    Otherwise, I can see spammers just changing there spam messages to have non 'a' based url's in the post to link back to their sites.

  23. clintology
    Member
    Posted 10 years ago #

    I forgot all about the auto_linking. It seems that that filter gets applied AFTER this one. Is there any way to hook into the comment_text after all other filters?

  24. clintology
    Member
    Posted 10 years ago #

    Hey I just found out the solution, I think I can lower the priority of the filter so that it gets applied last. A priority of 10 should accomplish that.

    My wordpress installation doesn't seem to auto link URLS (1.2.2) so I'm not sure what options you guys have set that I don't. I changed the filter to have a priority of 10 (lowest) so that it should be the last filter to be run across the test.

    Re-download it from the site: http://www.phaedo.cx/includes/wpNofollow.php.zip and please let me know if it catches those.

  25. dleber
    Member
    Posted 10 years ago #

    Yeah Clint, that fixed it for me.
    I changed the last two lines of wpNofollow.php to read:
    add_filter('comment_text', 'nofollowfy', 10);
    add_filter('comment_excerpt', 'nofollowfy',10);

  26. clintology
    Member
    Posted 10 years ago #

    That's exactly what I did to update it, dleber :) Good to hear it works!

  27. chrisgeleven
    Member
    Posted 10 years ago #

    I like the way LiveJournal is doing this, by letting "friends" have their links with no "nofollow".

    This can partly be done by allowing registered users to post comments with links without "nofollow" added. For those who just post comments and not register, perhaps after x approved comments (say 5) "nofollow" will not be added for that poster's comments.

    Another good idea is to put "nofollow" onto links for a period of time, then get rid of it (this assumes that a spam comment will be deleted at some point).

    I think a combination of all of the above needs to be done and that there should be some kind of default (not the status quo!) in WordPress. It doesn't have to be as extreme as some blogging services adding "nofollow" to every comment, but it should be at least enough that by default the incentive to post a spam comment on a WordPress blog is not as good as it is right now.

    It isn't perfect, but it is a good step and properly designed into WordPress it could really help our fight against comment spam.

  28. icheyne
    Member
    Posted 10 years ago #

    Please could you send your plugin to http://wp-plugins.net/ ? One-click installation and easy updates are great for lazy people like me.

    There is another nofollow plugin already there, but this one works fine for me.

  29. clintology
    Member
    Posted 10 years ago #

    Its now up at wp-plugins.net and works with 1 click install

  30. PantherMachina
    Member
    Posted 10 years ago #

    To add onto the other votes for discretionary control over the nofollow attribute: I'd like to point out that the blogs I comment on, I do so because they interest me and have something useful to say. I might also trackback to these same discussions on my blog, so why should I be punished because I have something actually worthwhile to say on the topic?

    I'm not comment whoring like some may think but commenting and browsing like everyone else does. If all I wanted was PageRank I would join the different pingers and whore them for hits and rank, instead I just want people that are interested in the same topics I am, to eventually browse to my site/blog.

    I do like the idea that we could have such finer controls over it as to decide that those that registered on your blog aren't flagged, or that those that are in our friends or links list should also not be flagged, but where is the off button? We can turn most features off, why doesn't this come with one? And I talking directly about 1.5 since this is a plugin so it's optional.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.