Quantcast
Viewing all articles
Browse latest Browse all 5

Custom Post Type & Custom Taxonomy’s URL Rewrite to remove their slugs

If you ever need to remove slug completely from your WordPress’s URLs for Custom Post Type or Custom Taxonomy, set ‘slug’ to ‘/’ and ‘with_front’ to ‘FALSE’ for rewrite parameter while registering custom post type or custom taxonomy.

'rewrite' => array(
               'slug'       => '/', 
               'with_front' => FALSE
             ),

Don’t forget to visit Settings->Permalinks page to flush old url rewriting rules to update changes.

Image may be NSFW.
Clik here to view.
LinkedIn
Image may be NSFW.
Clik here to view.
Share


Viewing all articles
Browse latest Browse all 5

Trending Articles