How to retrieve text only from a post using WP CLI?

I have the post ids and urls. I need to extract the post content make some modifications and update again. I have more than 2,000 posts hence I would like to do it using WP CLI and not manually. Can I know how do I do that?

EDIT : I need to take the entire text and -

  1. change the fonts. Remove some html tags.
  2. add some internal links.
  3. Append with a link to our facebook and twitter page.
  4. Include a Ad code.

For all posts

Topic wp-cli command-line content Wordpress

Category Web


Changing fonts and stripping tags can be done with a mySQL query. You'll just need to figure out the right regexes to search and replace.

For everything else, it sounds like you would be better off updating the single.php template. Social links, ad codes, all those sorts of things are better managed in a single place so that if they ever change, you can update them once and you're done. You can also more easily segment that part of the code outside of the main content, which ideally is in a <main> tag, so that search engines and assistive technology recognize which parts are templated and what part is the actual unique content of a page.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.