Use WP-CLI search-replace
The WP-CLI search-replace
command can be used to search and replace strings in a selection of database tables. This is useful for updating post content and options, especially when changing URLs for sites on a WordPress multisite.