This code, once added to your child themes functions file, adds rel=”nofollow” to all the tag cloud links generated by the tac cloud widget included in all WordPress installations by default.
The above code uses str_replace which is the correct function to use in this case.
You could also use preg_replace which is generally used to perform a search find and replace for regular expressions however this is not recommended in this case as the default code we need to modify/filter does not contain regular expressions.
Leave a Reply