最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp cli - How can I search and replace by post type?

programmeradmin0浏览0评论

I am trying to use WP-CLI to do a search and replace on about 10,000 posts that were imported from another CMS and it has a great deal of old inline styles and spans and such. I would like to be able to use the search and replace function to remove a lot of chaff using regex. I have no issue creating the regex or limiting my command to just the content column in the wp_posts table, but I do not see a built in way way to limit my post_type to only post, not page or others that are in the wp_posts table. Is there one?

Here is a code example:

wp search-replace '<span^.*>' '' --regex wp_posts --include-columns=post_content

发布评论

评论列表(0)

  1. 暂无评论