Haven’t found a useful answer for this. I am aware of the conflict issues and all the problems this may cause, I’m curious if it’s POSSIBLE not SUGGESTED. This will require WP rewrites, I know this much.
Basically, let’s say we have a CPT of “events”. I want to have a single event’s page have the URL http://domain.com/single-event-name and NOT http://domain.com/events/single-event-name. Any ideas on how to go about it?
That’s how you can do first part of the job – get rid o CPT slug in post link (eg. news post type).
Now there should go a a rewrite rules for ‘news’, because you will get a 404 error.
Add the rewrite rule like this:
Then we’ll need to flush rewrite rules, so go to Settings – Permalinks and save changes.
You can try this plugin( http://wordpress.org/extend/plugins/remove-slug-from-custom-post-type/ ) for removing the slug, but it will only work if the permalink structure is “/%postname%/
flush/recycle url rewrites, then edit .htaccess
You could always hook into “parse_request” to perform a check to see if a custom type with the name requested exists and then modify the query_vars appropriately. You’ll need something along the lines of @Bartosz’s response to generate the permalink in addition:
This does assume however that you won’t have any post names with the same name as a postname otherwise, the post will never appear as it matches with an event type first.