WP CLI: search and replace specific directory name of URL
Instead of using ” to wrap your expressions, use ‘. Further experimenting shows me that this is incorrect—both ” and ‘ should work, as long as they’re matched (ie, you don’t accidentally try something like wp search-replace “domain.com/wp-content/uploads/(\d)/(\d)/(\d*)/’ “domain.com/wp-content/uploads/\$1/\$2/” –precise –all-tables –skip-columns=guid –regex. (Note that the regex in that example starts with ” and ends … Read more