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 a filter or hook that is triggered just before post content is rendered?

What I'd like to do is to apply a filter to the text content of a post just before the post text is being rendered.

share|improve this question
up vote 3 down vote accepted

Can you not simply use the_content filter hook?

function mytheme_content_filter( $content ) {
     // Do stuff to $content, which contains the_content()
     // Then return it
     return $content;
add_filter( 'the_content', 'mytheme_content_filter' );
share|improve this answer
That's simply the filter I was looking for. – Luke Jul 8 '11 at 21:04
Resurrecting this old thread to notice that, by using the filter, all tags get stripped. How can I keep my tags? – Ciprian Nov 13 '12 at 9:17
@CiprianPopescu I would recommend starting a new question. It sounds to me like your issue isn't necessarily related to this question or answer. Adding your own question would allow you to elaborate more on the exact nature of your issue. – Chip Bennett Nov 13 '12 at 14:20

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.