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