How to rewrite URL to use dash in place of slash in Custom post type URL

by Jamil Ahmed   Last Updated March 14, 2017 12:08 PM

I have Custom post type "Restaurants" and URL permalink structure being used is displaying as follow

  1. site.com/restaurants/categories/animals/
  2. site.com/restaurants/post-name
  3. site.com/restaurants/location/Lahore/

and I want to use dashes in place of slashes and swapping some order e.g

  1. site.com/best-animals-restaurants
  2. site.com/restaurants-post-name
  3. site.com/best-restaurants-Lahore

Can I do it with WordPress rewrite or .htaccess rule ?



Related Questions




Change CPT permalink to use the category

Updated June 11, 2019 20:08 PM