• Resolved David Wang

    (@blogjunkie)


    Hi Brice, thanks for an excellent plugin! I have a feature request: can you please add rel="nofollow" to the links that output from the plugin?

    I am using the plugin to cross-promote my sites e.g. Site A is displaying latest posts from Site B and vice versa. I am worried the sites will get penalized by Google for linking to each other like this.

    I hope you can add this feature, otherwise please let me know how I can use one of the filters to add the nofollow attribute. Thank you

    https://wporg.ibadboy.net/plugins/feedzy-rss-feeds/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,
    You can easily achieve this with this hook :

    function bweb_feedzy_add_nofollow_matches( $matches ) {
        return '<a href="' . $matches[1] . '" target="_blank" rel="nofollow">' . $matches[2] . '</a>';
    }
    function bweb_feedzy_add_nofollow( $content, $feedURL ) {
        $pattern= '/<a.*href=\"(https?:\/\/.*)\".*>(.*)<\/a>/iU';
        $content= preg_replace_callback( $pattern, 'bweb_feedzy_add_nofollow_matches', $content );
        return $content;
    }
    add_filter( 'feedzy_global_output', 'bweb_feedzy_add_nofollow', 9, 2 );

    Cheers 😉

    Thread Starter David Wang

    (@blogjunkie)

    Great stuff! Thank you so much for this awesome plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Nofollow attribute for links’ is closed to new replies.