how to remove slug from url ?
example.com/example/new-post/
how to remove /example/
?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityWhenever you register_post_type()
, one of the args is rewrite
where you can reset the URL to something else. Maybe you can play with this -- try leaving it blank?
Pro tip: You will have to reset permalinks after you do this.
Admin Dashboard > Settings > Permalink: Choose Custom Structure then set your custom structure.