To make it more clear: (From the comments on the question)
Q: The “output” or “HTML” of which function exactly?
A: Any. I’d like these attributes removed from my whole theme.
WP & Functions:
WordPress has around 2.5k functions with the current version 3.4.2. Now imagine, that we would (or even could) check each function before it is run and then intercept with a str_replace
, preg_replace
or similar: We would probably slow your theme down by a factor of 10-100.
Alternate approach(es):
NOTE: Not that I’d suggest any of that.
- You could use
ob_start()
, etc. and catch the output, parse it and bring it back in. - Use js to manually remove it after the DOM has loaded
NOW this is my suggestion: Simply don’t do it. The rel="whatever"
attributes don’t harm anyone or anything. The opposite is the case: Google (and other SEs) have a much easier time finding and indexing your content.