No follow Custom Text widget or Disable?

I am having Problems with the custom Text widget it seem a great loophole for Massive outgoing One Way linking

“stop thief!”

Any How is there any way of removing the Functions

function wp_widget_text

function wp_widget_text_control

function wp_widget_text_register

from wp-includes/widget.php so its not available from the Themes

Or

Nofollow Tag on the text-links going into the Custom Text Box

Any Ideas

willing to Learn

  • drmike
    • DEV MAN’s Mascot

    There’s a total of one thread on adding nofollow to outbound links on the mu forums. Nothing ever came of it but I wanted to point it out:

    http://mu.wordpress.org/forums/topic.php?id=6974

    And I found these plugins yesterday that I point out since one of my own clients had a question along these lines but for sites like wikipedia, digg and the like:

    http://wordpress.org/extend/plugins/add-nofollow-links/

    http://www.inverudio.com/programs/WordPressBlog/NofollowReciprocity.php

    But to answer you’re question, line #952 of /wp-includes/widgets.php shows the filters applied to the text widget.

    The filter you want is ‘widget_text’

    The one you want to apply I believe (and someone is going to have to check on this) is ‘wp_rel_nofollow’

    So it should be:

    add_filter(‘widget_text’, ‘wp_rel_nofollow’:wink:

    Someone needs to check me on this though. Shoudl work.

    edit: Yup, that’s the filter. Compared what I wrote with the dofollow plugins and that’s what gets removed.

  • Bill007
    • Design Lord, Child of Thor

    Dr Mike

    My widgets.php is not reflecting any thing you have written

    the closest I can get to any similar is

    #598 $text = apply_filters( ‘widget_text’, $options[$number] );

    When I apply the Extra php filter ‘wp_rel_nofollow’ as below

    #598 $text = apply_filters( ‘widget_text’,’wp_rel_nofollow’, $options[$number] );

    the above wipes out the Text in the custom text Box and replaces it with

    wp_rel_nofollow

    One Great thing is Im in the right location

    I only wont to curb the linking Pattern out of this Custom text Widget its so easy to just Copy and Paste a preformed code snippet in there.

    My Customers can create as big as blog roll as they Like with no cloaking

  • drmike
    • DEV MAN’s Mascot

    Actually I see what the issue is. With what you’re doing, you;re telling it to replace the content of the widget with that text. Note the ‘apply_filter’ bit in there.

    What you want to do is tell wordpress which filter to use. That’s where the add_filter command comes into play.

    Try doing this as a simple plugin and see if it works:

    add_filter('widget_text', 'wp_rel_nofollow')

    You could probably add it directly into wp-includes/default-filters.php as well. Cut down on processing yet another plugin.

  • Bill007
    • Design Lord, Child of Thor

    Dr Mike whats your Thoughts

    I added the Filter into

    wp-includes/default-filters.php

    add_filter(‘widget_text’, ‘wp_rel_nofollow’:wink:;

    the resultant output on the link is

    http://xxxxxxx.xxxxblog.co.nz/”http://astore.amazon.com/Cheap.Apple.iPod.Shuffle.Accessories-20/”

    It seems to be putting the whole sub-domain of the Blog in front of the Link

    I haven’t Built a plugin yet as that’s a learning curve I need to take I’m keen but right now I’m busy too, Kind of like the Idea of reducing Over head though

  • drmike
    • DEV MAN’s Mascot

    Would you believe it worked for me using r1636 out of trac?

    The only problem is it escaped the double quotes:

    This is a <a href="http://drmikessteakdinner.com" rel="nofollow">Test Link</a>

    I added the line right after the Atom SSL support section. Let me go work on this.

  • Bill007
    • Design Lord, Child of Thor

    Yeah I spent a long time on this last Night went thru the codex found where I needed to be in adding a filter and it concurred with your advice

    How ever its gone past my know how at the present moment, although I am a master of persistence and will get it eventually