I'm using the following command to remove [download id="XXXX"]
patterns:
wp search-replace '\[download id="([0-9]+)"]' ' ' wp_posts --regex --regex-flags='i'
But it didn't replace anything.
Try the following:
wp search-replace '\[download id="([0-9]+)"\]' ' ' wp_posts --regex --regex-flags='i'
You escaped the square opening bracket, however, left the closing one without a backslash. The regex will fail because you closed a character group that was never opened.
Fixed!
wp search-replace '\[download id=\"([0-9]+)\"\]' ' ' wp_posts --regex --regex-flags='i'
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.