I have a plugin that will send tutorial emails to our users. These tutorials are created in wordpress and stored in wp_posts table in the database.

Of course I could simply run a query to get the post and that's it. But is there a special built-in function that I can use to get the post content after Wordpress post processing?

I am thing of using get_post but I'm not sure if this is the best thing to do:

$my_id = 7;
$post_id_7 = get_post($my_id); 
$post_content = $post_id_7->post_content;

Thanks for any tips.

  • By "after post processing", do you mean you want the content with the html edited (<p> tags added, etc), or do you just mean after the post has been saved?
    – jfacemyer
    Commented Mar 5, 2013 at 2:33
  • Yes I mean all formatting and all processing..not after the post has been saved. Commented Mar 5, 2013 at 2:47

1 Answer 1


If by "post processing" you mean the autoformatting, the shortcode processing, that sort of thing, then you want to pass the content through the the_content filters.

$my_id = 7;
$post_id_7 = get_post($my_id); 
$post_content = $post_id_7->post_content;
$post_content = apply_filters('the_content',$post_content);


You can see much of what will be applied by default by looking at the source of wp-includes/default-filters.php. However, plugins and themes can add filters so you may find that you want to pick and choose what gets applieds.

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.