CUSTOM POST TYPE & CUSTOM TAXONOMY’S URL REWRITE TO REMOVE THEIR SLUGS

  • AUTHOR: // CATEGORY: WordPress, WordPress Plugin Development, WordPress Theme Development

    No Comments

    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.

    LinkedInShare

    Comments

    comments

COMMENTS

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

LEAVE A REPLY

FILL THE FIELDS TO LEAVE A REPLY. Your email address will not be published.