永久链接从%day%更改为%id%后,Wordpress 301重定向

On a Wordpress blog, with posts permalink setup like this: /%year%/%month%/%day%/%post_name%/

How to massively change the permalinks to this: /%post_name%-%post_id%/. I have about 10,000 articles.

  1. Change the permalink from wordpress settings - done.
  2. Create a redirection for all link /1970/01/01/this_is_a_post/

How to do the step 2?

People will arrive on /1970/01/01/this_is_a_post but they will find a 404 as the post is now under /this_is_a_post-00022.

Try this...

  1. Download the WordPress Simple 301 Redirect plugin: https://wordpress.org/plugins/simple-301-redirects/
  2. Create a redirect and enter the following in the request field: /%year%/%month%/%day%/%post_name%/ and the following in the destination field: /%post_name%-%post_id%/
  3. Voila! You're all done.