Categories
WordPress

Search and replace content with WP-CLI

$ wp search-replace '[shortcode_1]' '[shortcode_2]' wp_posts --skip-columns="post_title,post_name"
Replaces [shortcode_1] with [shortcode_2] from wp_posts table and skips columns post_title and post_name. Add --dry-run flag if you want to see the results without applying changes.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.