How to seamlessly redirect between different archive and singular slugs?

  1. Hook into '404_template'. (Example)
  2. Fetch all public custom post types where has_archive is not FALSE.
  3. Find the post type’s has_archive string and see if it is part of the current request’s url.
  4. Try get_page_by_title() with the last part of the requests.
  5. wp_redirect() to the found post’s permalink.
  6. exit;.

Leave a Comment