WordPress.org

Support

Support » How-To and Troubleshooting » Please help me change rel="nofollow links to dofollow

Please help me change rel="nofollow links to dofollow

Viewing 6 replies - 1 through 6 (of 6 total)
  • You can try this, which will filter the_content, and replace rel=”nofollow” with an empty space.

    function mtn_weekly_fix_rel_follow( $content ) {
        // Find rel="nofollow", replace with empty space.
        $content = preg_replace( '/rel="nofollow"/', ' ', $content);
        return $content;
    }
    add_filter( 'the_content', 'mtn_weekly_fix_rel_follow', 20 );

    Thanks for the reply however this seemed to break the site. Any other suggestions?

    Try this…

    function mtn_weekly_fix_rel_follow( $content ) {
        // Find rel="nofollow", replace with empty space.
        $content = preg_replace( '(rel="nofollow")', ' ', $content);
        return $content;
    }
    add_filter( 'the_content', 'mtn_weekly_fix_rel_follow', 20 );

    Scratch that…when you say it broke your site, what do you mean. That’s a simple find and replace filter on the content of your site.

    still having no luck with this. I guess we could go through the 2500 articles and manually change all the nofollow to do follow links?

    Any other suggestions?

    http://mtnweekly.com

    I’d use a plugin like http://wordpress.org/plugins/search-and-replace/

    First off do a search for rel=”nofollow” and see what results it returns.

    Then after you think it is safe and only will change what you want do a search and replace to remove them all.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Please help me change rel="nofollow links to dofollow’ is closed to new replies.
Skip to toolbar