Great question — answering as the UphillTech team:
I already had this challenge before and here is my personal solution for you: 1. For the tag cloud widget you can use this approach: add_filter('wp_tag_cloud', 'add_nofollow_to_tag_cloud'); function add_nofollow_to_tag_cloud($content) { // Add 'nofollow' to the links $content = str_replace('<a href="', '<a rel="nofollow" href="', $content); return $content; } I already tested this locally and it works fine. 2. For the get_the_tags() function you can add this function: add_filter('term_links-post_tag', 'add_nofollow_to_tag_list'); function add_nofollow_to_tag_list($tag_list) { $tag_list = str_replace('<a href="', '<a rel="nofollow" href="', $tag_list); return $tag_list; } The outcome will be...
Full answer by Cristian Stan: https://wordpress.stackexchange.com/a/426113 (CC BY-SA 4.0).
Need it done for your business? UphillTech.