When a post belongs to more than one category, regardless of their parent/child structure, WordPress will use the category with the lowest ID in the permalink. If that lower ID belongs to a child category, you’ll see the parent/child structure in the permalink.
If you always want parent/child category appearing in the permalink, a simple solution would be to only assign the child category to the post.
Related Posts:
- Change media item permalink
- Creating custom permalink structure for languages
- Permalink not working for page without title
- What is the difference between get_permalink vs get_the_permalink?
- Is the permalink structure /%post_id%/%postname% faster or slower than just /%postname%?
- Post titles not letting me use 2 consecutive dashes in permalink
- Using underscores instead of hyphens in the permalink
- How can I force WordPress to redirect to canonical permalinks?
- Remove subfolders from URL
- 404 on category.php pagination
- flexible rewrite ‘ramble’ URLs with WordPress
- Changing pemalink structure to /%post_id%/%postname%/
- Custom permalink structure
- How to get rid of index.php?
- Relative or Absolute Paths for Flash Video Player Files
- Update Old Links To Pretty Permalinks Custom Post Type
- WordPress Permalinks %postname% for RSS2 Feed URL
- remove permalink trailing slash
- Use Single Blog Post as Site Front Page Without Redirect
- wordpress permalinks tweeks
- generate custom permalink based on a custom field
- Redirect old permalinks with Month and name to Post name on new site
- .htaccess – Redirect duplicated post ended in ‘-number/’ to the same url without the -number/
- WordPress Permalinks on Mac OSX Server 5 (El Capitan)
- How to find out who handles a permalink?
- Getting links to work the same on development and production
- Permalink /%category%/%postname%/ returns 404 on OSX
- Page Attachment Permalink Structure based on Menu Order?
- stop the_permalink printing and save as variable?
- Change author slug and functionality
- Setting up two separate blogs while using WordPress as a CMS
- Custom theme navigation
- get permalink and append it
- How to redirect to correct pages after permalink structure change
- Moving local wordpress page to a real server subdomain broke my permalinks?
- Remove parent category from permalink but keep breadcrumbs structure
- Only plain permalinks working
- next_posts_link URL does not include name of custom post type
- Media Gallery Images – safe to change permalink?
- How to remove specific category from URL in WordPress
- How to set permalinks when posts and pages have different URL structures?
- redirect/ %category%/%postname%.html to /%category%/%postname%
- WordPress disallows changing page to a specific permalink
- Permalink Doesnt Work – URL Not Found
- WordPress 4.4 old permalink redirect
- 404 when going to /blog
- WordPress keeps giving me the wrong permalink
- Permalinks 404 error with HTTPS host
- Empty permalinks settings in .htaccess
- Rewriting single post url; add_rewrite_rule problem?
- Update the permalink for one post via wp cli
- How can I make internal anchor links work with WordPress’s permalinks?
- wordpress how to replace url /bar with foo/bar for custom post type
- Can WP give a value a post ID?
- Page Name and Permalinks
- Getting back a permalink from custom url
- how to get a list of all top level pages
- Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?
- Permalink sub-routing catch-all
- I’ve removed my /author/ slug but it clashes with new and existing pages. Any fixes?
- Changing the entire permalink
- How are WordPress Page URLs affected by permalink settings?
- Home page Pagination – Other pages do not redirect to home page template
- How do i get post thumbnail using attachment code
- Access posts while mod_rewrite is broken
- Update page breaks permalinks
- WordPress switch servers
- Tag pages do not show
- WordPress Posts forced to load as Uncategorized
- Permalinks Question: Adding a prefix ONLY in front of the posts
- Modify post slug before saving
- Permalink refresh, the good, the bad, etc. What is best?
- Xampp 7.3.3 fresh install of WordPress 404 pages unless permalink is set to plain
- Make the blog page a child of another page and rewrite the blog url
- WordPress slug confusion
- Author URL using wrong domain after using Edit Author Slug
- 404 on wordpress multisite Permalink pretty URLs
- 404 on pretty permalinks when serving via HTTPS
- Question About Permalink in wordpress
- Create new URL structure for custom post types
- append current user-id to all internal permalinks
- How to find a page in admin based on it’s permalink
- Page returns 404 for specific permalink
- issue with the_permalink
- Pagination links for taxonomy archive page 404 error on every page except first
- Facebook Share Permalink Javascript href
- Change all pages permalinks instead of hierarchical to have id of the page
- where is the media permalink info stored in database?
- Links after changing hosting and domain
- How can I get WordPress CPT archives and page templates to work with prettified permalink settings?
- Passing user defined variable into get_permalink
- Custom Permalinks and filters?
- Custom permalink structure for custom post type results in 404
- ?posts_type=xxx not rewritten
- Change permalink when page category selected in admin
- Category pagination first link works, remaining don’t
- Custom rewrites for pages and categories
- Why doesn’t my page know it’s a page (won’t return true for is_page())?
- How to change my URL on intranet
- Settings > Permalinks – mod_rewrite ineffective if expression not preceded by /index.php/