I have a sidebar with 10+ text widgets serving advertisements. Now I want to filter a particular text widget in a single post if that post has a data in meta field. I searched a lot and found Is There A Hook To Process The Content Of The Text Widget?. But this changes the content of all text widgets. How can I change a particular text widget?

1 Answer 1


Is it default text widget? If yes, then I don't think there is a way.

Why don't you create a custom text widget? And before echoing output process the text whatever you wants to do?

The logic is, you will create another widget, that will take some text (or html?) and you will process that text, add some data what you want and show as output :)

  • Great! Your Solution works form me. This is what I need. Mar 25, 2015 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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