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 /%post_id%/%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 for bulk URL update via wp-cli


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: