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

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.