remove permalink slug from"front part" for custom post type

Source Link
xrep
  • 53
  • 3

remove permalink slug from custom post type

Let's suppose I have CPT "event". In register_post_type, I've set

'slug' => 'event'

Then, in Wordpress settings I've set following Permalink structure

Custom: http://www.domain.tld/news/%postname%/

The problem is, URL for my "Event" CPT is

www.domain.tld/news/event/<event-name>

and I want

www.domain.tld/event/<event-name>

how can I achieve that?

Thanks