6/7/2018 - 6:27 PM

replace url with wp cli

# Search and replace but skip one column
$ wp search-replace '' '' --skip-columns=guid

# Run search/replace operation but dont save in database
$ wp search-replace 'foo' 'bar' wp_posts wp_postmeta wp_terms --dry-run

# Run case-insensitive regex search/replace operation (slow)
$ wp search-replace '\[foo id="([0-9]+)"' '[bar id="\1"' --regex --regex-flags='i'

# Turn your production multisite database into a local dev database
$ wp search-replace 'wp_*options' wp_blogs

# Search/replace to a SQL file without transforming the database
$ wp search-replace foo bar --export=database.sql

# Bash script: Search/replace production to development url (multisite compatible)
if $(wp --url= core is-installed --network); then
    wp search-replace --url= '' 'https://docker.local' --recurse-objects --network --skip-columns=guid --skip-tables=wp_users
    wp search-replace '' 'https://docker.local' --recurse-objects --skip-columns=guid --skip-tables=wp_users

## css js Problem after import db
## remove db entry _transient_wp_core_block_css_files