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

I am using $page = get_page_by_title('name'); to get the contents of a page. When I echo $page->post_content; none of the content is wrapped in p tags like it is when run threw the normal wordpress loop using the_content(). Is there a different way I should get this data so it will contain the proper tags?

share|improve this question
up vote 0 down vote accepted

You can apply the content filters to $page->post_content like so:

echo apply_filters('the_content', $page->post_content);
share|improve this answer
Awesome. Works perfect. Thank you. – jppower175 Feb 6 '13 at 0:41

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.