admin管理员组文章数量:1416651
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 -
- change the fonts. Remove some html tags.
- add some internal links.
- Append with a link to our facebook and twitter page.
- Include a Ad code.
For all posts
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 -
- change the fonts. Remove some html tags.
- add some internal links.
- Append with a link to our facebook and twitter page.
- Include a Ad code.
For all posts
Share Improve this question edited Aug 9, 2019 at 15:50 Trect asked Aug 9, 2019 at 14:54 TrectTrect 1537 bronze badges 2- What kind of modifications? Please add more detail. wp-cli can e.g. handle search and replace. – birgire Commented Aug 9, 2019 at 15:33
- @birgire I have made the edits. Have added more details – Trect Commented Aug 9, 2019 at 15:51
1 Answer
Reset to default 1Changing 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.
本文标签: contentHow to retrieve text only from a post using WP CLI
版权声明:本文标题:content - How to retrieve text only from a post using WP CLI? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745255378a2650066.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论