How to remove dates from permalinks in WordPress and 301 redirect them to the post on WP Engine

Today I needed to update the permalink structure to remove the dates from blog posts on an old website. It’s easy enough to remove the dates – just go to “Settings”->”Permalinks”, and select the “/%postname%/” option – done! Buuuut there’s still the problem of 301 redirecting old urls so as to not lose SEO value. Here’s how to do it on WP Engine:

  1. Visit your WP Engine control panel (it’ll be a url such as “https://my.wpengine.com/installs/USERNAME/redirect_rules”).
  2. Click on “Redirect Rules”.
  3. Click on “New Redirect Rule”.
  4. In the “Source” box, put: ^/\d{4}/\d{2}/\d{2}/(.*)
  5. In the “Destination” box, put: /$1
  6. Click “Save”, and you’re done!
How to remove dates from permalinks in WordPress and 301 redirect them to the post on WP Engine
How to remove dates from permalinks in WordPress and 301 redirect them to the post on WP Engine 2

Is this helpful?

Posted in

Toby Cryns

Toby Cryns is a freelance CTO, expert WordPress developer, and teacher.

He offers free advice to improve your freelance biz.

He also publishes small droppings every now and them to https://twitter.com/tobycryns and https://twitter.com/themightymo.com

Follow Toby's contributions on Github and WP.org.