Skip to content

Instantly share code, notes, and snippets.

@tomhemsley
Created June 30, 2014 14:34
Show Gist options
  • Save tomhemsley/13ee1c6d4ee115fbed56 to your computer and use it in GitHub Desktop.
Save tomhemsley/13ee1c6d4ee115fbed56 to your computer and use it in GitHub Desktop.
Add rel=nofollow to all Meta Slider links
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*/
function metaslider_nofollow($attributes, $slide, $slider_id) {
$attributes['rel'] = "nofollow";
return $attributes;
}
add_filter('metaslider_flex_slider_anchor_attributes', 'metaslider_nofollow', 10, 3);
add_filter('metaslider_nivo_slider_anchor_attributes', 'metaslider_nofollow', 10, 3);
add_filter('metaslider_responsive_slider_anchor_attributes', 'metaslider_nofollow', 10, 3);
add_filter('metaslider_coin_slider_anchor_attributes', 'metaslider_nofollow', 10, 3);
/* END metaslider no follow */
@savingsbazar15
Copy link

Hello,

I have pasted this code in my functions.php file... I am still unable to find nofollow tag inside anchor tag...

Can you let me know whether I have to copy the above code as it is or make some changes to it ?

@sankars789
Copy link

Hi savingsbazar15,
Add the above code at the end of the functions.php file.

@YunarW
Copy link

YunarW commented Jul 31, 2019

Excellent this still works in 2019 with Metaslider ver 3.13.1 and Wordpress ver 4.9.10 running Bookshelf theme

@jeretiens
Copy link

Hello there,

Just found what I searched for a while, this code still works !

Thanks A LOT for sharing this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment