Permanent Redirect for custom post type

Question

I have changed the slug for a custom post type from nightlife to socialize so all of my custom posts have moved, for example from:

https://www.domain.com/nightlife/my-same-custom-title1/

to

https://www.domain.com/socialize/my-same-custom-title1/

However, wordpress does not redirect the old custom slug to the new custom slug. How could I write a custom function to do this?

I need this for SEO purposes, otherwise Google will de-index the old URLs if it can’t find them.

0
JoaMika 3 months 0 Answers 18 views 0

Leave an answer