How can i avoid the permalink start with ‘blog’ while using the custom post type?

I used the custom Structure /blog/%category%/%postname%/ for blog. also i have a custom post type named ‘FAQ’ while viewing the faq posts, it is showing the /blog/faq/%faq_category%/%postname%/. When I’m using the ['with_front' => false] the paged URLs (‘Old entries’ and ‘New entries’ links) http://www.example.com/faq/page/2/ are always showing the 404 page.

2 Answers
2

This can be set in a plugins’ options if you’re using a plugin to generate a Custom Post Type (such as CPT UI).

Otherwise if you’ve created this post type in the functions.php file you should amend or add to your your code as follows:

'with_front' => false

i.e. if your permalink structure appears as:

yourwebsite.co.uk/blog/custom-post-title

then setting this to ‘false’ will make your url something like:

yourwebsite.co.uk/custom-post-title

Leave a Comment