The methods you offer for comparison are pretty much the same, with minor API differences and whether the_content
filters are applied.
Within the loop get_the_content()
should typically be used, which properly handles split into pages and so on.
To retrieve raw content get_post_field()
is generally suitable, but any further processing (such as the_content
filters) heavily depends on specific purpose of retrieving content and what you are going to do with it.
PS take note that many extensions out there are dumb and variously break on the_content
filter executed outside of loop / more than once.
Related Posts:
- Stop WordPress Wrapping Images In A “P” Tag
- Stop WordPress automatically adding tags to post content
- Get content from one page and show it on another page
- Strategy for handling hierarchical pages with empty parent content
- How to remove Nextpage tag inside posts text depending of utm_campaign
- How can you make sure authors’ posts are longer than 250 words?
- JSON not valid after json_encode posts
- Add default content to post (for specific category)
- Programmatically inserting page breaks
- Hide parts of the post content on the home page
- Filter/Remove HTML Elements on all posts and pages
- Paragraphs removed when using get_post_custom()?
- Load post content into div with ajax
- Testing for post title in ‘if/else’ statement returns no content
- Same content shared between multiple posts?
- how load content as pop-up using ajax
- How to get only text from wordpress post content?
- Batch process: remove first image from post content
- Why content_arr[‘extended’] removes paragraph tags?
- Unautop / Sanitize content added to a post through a plugin
- is there a way to show the the post title after the image?
- How to get rid of shortcodes in post content once and for all
- Add Word Limit to Posts
- Show only one page link in content pagination
- Show only posts with images and a fixed amount of posts
- How to create new post content templates for my users?
- How do I do a page break?
- How to get a post’s content? [closed]
- Why does a published post only displays the title and not the content in the site? [closed]
- Best Way to Add UnEditable HTML to Posts
- The_excerpt() doesn’t parse – how to change that?
- Page and post loop same template
- Benefits to using semantic HTML in post content? [closed]
- the_content() Not Grabbing All Content
- Can’t save WordPress post with “/etc/” in it
- content summary of a post disappears If an images added at the beginning of the post. how to solve it?
- Hide parts of the post content after typing it’s name or searching it by category
- How to exclude the word “class” from being matched in search?
- Preview page/post revisions without overwriting current content
- Posts and Pages w. private visibility don’t show up in existing content
- definining own teaser text for post
- Add text and change style to post programmatically depending on category
- why my urdu text is not aligned properly when written in wordpress blog post?
- How to Remove HTML Elements from Post Excerpt?
- My website is showing today’s date instead of published date since db migration to a new wordpress
- Related post not showing table of content
- How to get unmodified post content?
- I have inserted a post’s content in homepage.php by the post-id. The font isn’t matching with the theme. How do I change font of this content?
- How do I set content in my pages so that it remains permanent while blog posts are added below?
- Nothing appears using get_the_excerpt() in category.php
- WordPress each user has each content for a page,how to do that?
- Add caption to thumbnails in content
- Adding div to WordPress page content
- Adding editable content above posts
- How to get post_content while the post is being edited
- Custom template for different post types
- Correcting the content width when sidebar is inactive?
- Multiple approval from editors before publishing?
- Get part of a page url
- How can i show only 30% of the “the_content(“More…”)”?
- How to use wp_editor(); in functions.php then retrieve content in the template
- Add default content to post (for specific category)
- jquery: getting contents of #content field on post page
- Stripping tag from elements in post
- What does WordPress mean by they have full rights to content [closed]
- After the local installation of an old WP website I can see the homepage but I can’t access to the articles, why?
- wordpress pinboard theme [closed]
- Automatically search and replace link in content (pages/posts)?
- Notify/check if the content of a custom gutenberg block has changed on save_post
- How to get post creation date?
- Change slug with custom field
- Posts Page Featured Image [closed]
- Can’t publish new posts
- Two posts are loaded instead of one?
- how to find user ids of all commenters in a post
- Display post X of Y in category
- Ajaxify This Code
- Users problem (multi-author plus multisite)
- Filter only the text in the_content
- How to WP_Query() from multiple blogs and order them?
- Display author’s name and avatar in post’s sidebar
- How do you change the comment count in the back end posts list, to reflect unapproved comments, rather than all comments?
- Parent category / child category posts
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- How to check if a post is published today?
- How can I add a class to particular paragraphs in my post?
- Getting an extra post’s meta data?
- Link from Post to Another Post Via Clicking on Words within Original Post
- Insert JavaScript in a blog post or a new page?
- Order buttons added to TinyMCE
- How to create loop of posts except post ID defined via ACF field
- How to redirect if is post edit or publish page?
- How to delete/customize imported demo content from a theme or add my own?
- testing result of $.post with json_encode
- Clean up customize_changeset in DB
- Blog styling in SASS
- Get results from the main wp_query
- Pagination for custom query won’t let me back on page 1
- thumbnail image path and file path for gallery thumbnail images
- How to set value in Query Loop?