Change post type for WordPress posts with WP-CLI

In this example, I’m modifying all the posts with a legacy custom post type that I want to get rid of to use the Yoast SEO: Local custom post type for locations instead.

wp post update $(wp post list --post_type=locations --format=ids) --post_type=wpseo_locations

Leave a Reply

Your email address will not be published.