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?

1 Answer 1


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

echo apply_filters('the_content', $page->post_content);

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.