WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there one last filter that is ran over the widgets before they are sent out to the browser? I would like to add a filter that adds rel="nofollow" to all links in all widgets.

For instance, I can add a filter to the text widget:

add_filter('widget_text', 'xrvel_nfp_modify_nofollow');

But I don't want to hunt down every single hook for every widget. (Also, the RSS widget doesn't even HAVE a filter. Trac ticket submitted)

share|improve this question
up vote 2 down vote accepted

There is another thread on here that discusses a workaround.

Well... the familiar php workaround when a function does not provide a "get to variable" output actually... use ob_start: http://php.net/manual/en/function.ob-start.php to just capture the output and manipulate it before sending it on its way.

Leads on stackoverflow: http://stackoverflow.com/search?q=%2Bwordpress+sidebar+%2Bob-start+

share|improve this answer

The output is completely up to each individual widget. It is echoed directly by the widget's widget() method, so there's no general filters that apply to all of them.

share|improve this answer
That's poop. I was afraid that was the case. – Dan Gayle Feb 24 '11 at 21:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.