WordPress.org

Support

Support » Plugins and Hacks » Simple Links » [Resolved] Set nofollow by location?

[Resolved] Set nofollow by location?

  • While having a nofollow option per link is fine, what I would really like is that option available on the widget settings.

    On my site I have several widgets to display some links in various places and then a links page to show them all. Currently I have no way to have links as nofollow in some places but not the other.

    Anyway, while I appreciate this is maybe a wishlist item, if anyone knows a temporary way to achieve this I would be grateful.

    Thanks

    https://wordpress.org/plugins/simple-links/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mat Lipe

    @mat-lipe

    Hi redactuk,

    You are correct in thinking this plugin does not support this feature. Because it is not an often used feature it will probably not be added in the future.

    It could be accomplished by creating an add-on. Otherwise you could use the following code in your theme to accomplish this.

    Add this to your theme’s functions.php file

    function simple_links_remove_no_follow( $meta ){
    	$meta['link_target_nofollow'][0] = 0;
    	return $meta;
    }
    function simple_links_set_no_follow( $meta ){
    	$meta['link_target_nofollow'][0] = 1;
    	return $meta;
    }

    Above any section you want the no follow to be on for all links add

    add_filter( 'simple_links_meta', 'simple_links_set_no_follow');

    After the section add

    remove_filter( 'simple_links_meta', 'simple_links_set_no_follow');

    Above any section you want to remove the no follow add
    add_filter( 'simple_links_meta', 'simple_links_remove_no_follow');
    After the section add
    remove_filter( 'simple_links_meta', 'simple_links_remove_no_follow');

    Hope this helps

    Hi Mat, thank you very much for you helpful response, appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Set nofollow by location?’ is closed to new replies.
Skip to toolbar