Permalink structure for blog posts and pages are managed in WordPress Settings -> Permalinks
page, so to make blog posts have permalinks like blog/%postname%/
and you’ve done it right.
The tricky part is about Custom Post type permalinks declaration:
in your CPT arguments declaration there’s a rewrite
rule parameters, which in turn has with_front
– if this parameter is false
you’ll have permalink structure without prefix used for blog posts, and if it’s true
you’ll have what you’ve experienced. By default it’s set to true
.
So fixed part of rewrite parameter will look like.
'rewrite' => array(
'slug' => 'casestudies', // your case studies permalink base.
'with_front' => false, // important to make your links without base of blog posts.
'pages' => true, // set true if you need pagination for your cpt listing.
),
Related Posts:
- How to remove dates from existing permalinks?
- Getting the Site URL Including the Front Base
- Pretty Permalinks
- Force wordpress to display page with same url structure as categories
- Redirecting “wrong” but working links to their canonical URL in order to prevent search engine penalties (e.g. /123/ at the end of URLs)
- Is it possible to change the permalink structure without changing the old permalinks to posts and without 301 redirects?
- 301 redirects after changing permalinks
- My permalinks for all pages and posts now include old page titles as parents/categories
- How to change URL of my pages?
- permalinks url with woocommerce
- Need help with add_rewrite_rule
- How do I add /blog/ as a prefix to permalink structure for blog posts, tag pages, etc.?
- Permalink format: singular or plural
- How to get pretty URLs with add_query_arg in permalinks
- What is the best permalink structure for SEO?
- Custom post type permalink endpoint
- URL rewrite based on a custom field value
- How do I turn off 301 redirecting posts (not canonical)?
- How to change author base without front
- How to create a permalink structure for posts in a specific category
- How to map permalinks with accented letters to sanitized slugs?
- Add custom directory in URL
- Using two permalinks for one post
- Custom rewrite rules for a $_GET request
- Nice RSS Feed URLs for each custom post type
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Put post ID on the custom post type URL
- Rewrite url / permalink for default archive – yearly / monthly
- Permalinks, Rewrites, Get Variables, Oh My!
- Change permalink for a single post entry
- Remove the Parent category from the permalink but leave the child category
- Using ‘Primary Category’ in URL
- Apostrophe in permalink results in page not found
- Can’t get rewrite rules working
- Multilanguage URLs
- Rewrite my default post URL
- When is it a good idea to build a permalink structure from scratch?
- I need a custom permalink for my website
- How to reset canonical URLs / fix redirect loop
- Attachment Page Permalink/URL Rewrite Issue. How to change the actual rewriting?
- Permalinks: Page Not Found
- Does changing a post title of a published post automatically change permalink?
- Remove custom taxonomy base from URL
- Is a permastruct possible on pages?
- Rewrite rule for a query string
- How to add a variable as a tag base?
- WPML – how to get the permalinks to display also the default language
- One Specific Category To Permalink
- How can i have a custom post type with more slugs for each post?
- URL rewriting: removing the site’s basename for a specific category
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- Rewrite rule intended for CPTs gives 404 for pages
- Unable to get /%postname%/ permalinks working, 404 on all links
- Permalink structure between 2 custom post types and a taxonomy
- 404 error using Meta for Permalink rewrite
- Disable date based archives for all categories except one
- How to rename ‘Tag Base’ with WPeC 3.8?
- Custom rewrite rule ignored
- WordPress suddenly changed all links to example.com/example.com/
- How can I emulate permalink behaviour on static pages
- How to handle paging/pagination with a custom permalink?
- Remove parent page from url
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- Access or edit custom generated permalinks with WP_Rewrite
- optional parameter in permalink structure
- Rewrite rule not passing variable
- How to get raw unwritten querystring
- “set_front” => false on custom post type breaks wp_list_categories links [closed]
- All in One Seo and Permalinks
- Moving blog and maintaining current permalinks
- rewrite based slug standar post wp
- remove SLASH on single_post but KEEP on categories and parent pages
- WordPress keeps removing query var from the URL
- How can I access to the same post-type “page” from multiple different urls?
- Multiple URL rewrite rules and get every prams
- Got 404 error when changed siteurl via DB in WordPress
- Extra url paths as variable
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Add slug to default post permalinks ONLY
- Logging in to installation in subdirectory renders broken dashboard (no CSS, broken links)
- Permalink structure /page/page/cpt-post gives 404 with pagination
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Pretty Filter URL
- Dynamically populate permalinks
- Converting WP Page to use full explicit paths?
- Prevent guessing slug
- Once redirected by Rewrite rules, how can WordPress know the page?
- Pages included in another page and duplicate content issues for SEO
- Customize category permalinks
- Update permalinks
- Losing the original URL when using add_rewrite_rule
- Custom Permalink Base
- My wordpress site must be being affected by outside sources [duplicate]
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- Permalinks, how to show them in post
- How to get the perfect WordPress, WooCommerce, Custom Post Type pretty permalinks?
- Blog url disappears
- Blog URL Structure – Multiple Taxonomies