No Follow WordPress Tag Cloud Widget Links

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.

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.