Skip to content

Instantly share code, notes, and snippets.

@infoscigeek
Created March 18, 2017 05:27
Show Gist options
  • Save infoscigeek/e72d8db9140107709c3acb1ae98fc981 to your computer and use it in GitHub Desktop.
Save infoscigeek/e72d8db9140107709c3acb1ae98fc981 to your computer and use it in GitHub Desktop.
Use a filter to edit the get_the_term_list function
<?php
/* Add nofollow tag to all category and tag links on posts*/
add_filter( "term_links-post_tag", 'add_tag_class');
function add_tag_class($links) {
return str_replace('" rel="tag">', '" rel="tag nofollow">', $links);
}
/* End nofollow tag edit */
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment