Skip to content

Instantly share code, notes, and snippets.

@YunarW
Forked from tomhemsley/NoFollow
Last active July 31, 2019 10:05
Show Gist options
  • Save YunarW/7ea08b351aedd7410baa8e587cd05d7e to your computer and use it in GitHub Desktop.
Save YunarW/7ea08b351aedd7410baa8e587cd05d7e 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 (add at the end of last code).
*/
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 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment