regex SQL command for bulk URL update via wp-cli

We made URL permalink changes to WordPress sites, removing a no longer needed date in URLs and keeping just the domain, subfolder and postname.

from /%year%/%monthnum%/%day%/%postname%/
to /%postname%/

While the 301 redirect is working perfectly we have hundreds of URL references in post contents that we’d like to update at once with WP-CLI. Does anyone know how to create a regular expression SQL command for this in WP-CLI to remove the date from URLs, making all internal links current again?

Read more here: regex SQL command for bulk URL update via wp-cli

Leave a Reply

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