Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

For a custom post type page I'd like to completely remove the slug so that the URL structure mirrors or . If I set the rewrite parameter to

'rewrite' => array('slug' => '', 'with_front' => false)

Wordpress freaks out and I get 404 on all pages except for the CPT page. If I don't define slug at all, then it defaults to the CPT name.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You have to set 'slug' to false and not a blank string.

share|improve this answer
I had tried the same code and had a problem, you're saying to set 'slug' to false so is this right or wrong 'rewrite' => array('slug'=>false,'with_front'=>false), this doesn't work for me the slug's still being generated. What should the code be? Thanks –  Anagio Dec 22 '12 at 19:12
Setting the slug to false (and refreshing permalinks) seems to create a redirect for me to the full URL WITH the CPT-name/page-name –  BenRacicot Jun 15 '14 at 21:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.