Skip to content

Instantly share code, notes, and snippets.

@jdevalk
Created October 2, 2012 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdevalk/3822987 to your computer and use it in GitHub Desktop.
Save jdevalk/3822987 to your computer and use it in GitHub Desktop.
Nofollow all links to OrangeValley.
<?php
function orangevalley_link_nofollow( $content ) {
$content = preg_replace('#<a href=(\'|")http://www.orangevalley\.(nl|com)/(\'|")#', '<a rel="nofollow" href="http://www.orangevalley.com/"', $content );
return $content;
}
add_filter('the_content','orangevalley_link_nofollow');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment