Fix For 404 Page Not Found – Missing Posts For Child Category Archive Page

by | Apr 3, 2022 | Wordpress | 0 comments

When setting up the ‘blog’ section of my WordPress website for the first time, I came across an issue. For some reason, archive pages for my child category were not appearing underneath the parent-category/child-category permalink path.

Instead of posts from the child category Facebook, I was greeted by a 404 page not found when I visited archive page seosteph.co.uk/social-media/facebook/ .

Child Category 404 Page

Though it should’ve returned results, my child category archive page produced a 404 – zero results

However, if I navigated to the child category as though it was a parent (i.e. no parent category proceeding it in the permalink – e.g. seosteph.co.uk/facebook/ instead of seosteph.co.uk/social-media/facebook/) then the archive page displayed the posts belonging to the child category. “That’s not right!”, I thought.

I could understand this if my permalink structure didn’t include the parent category ahead of the child category, but it did. Even the category meta tags on my posts pointed to the archive page under the parent/child hierarchy.

When setting permalinks for my posts page through WordPress, I had used Custom Structure with /%category%/%postname%/ setup so that I could have a nice hierarchy to my URLs and it worked fine.

Wordpress Permalink Structure

My permalink structure for my posts prefixed with category name.

To further enhance my URLs, I used a dot (.) in the optional Category Base fields of the Permalinks settings to strip out the prefix ‘category’ that proceeds any category name in the permalink structure of WordPress posts by default. e.g. with the dot, seosteph.co.uk/category/social-media/facebook/ became seosteph.co.uk/social-media/facebook/

However, I discovered it was the implementation of the dot in the Category Base, to rid the prefix in the category permalink, that was causing my archive pages not to resolve as they should.

By removing the dot from the Category Base so the field is kept blank (as it is by default), and enabling Strip Category Base in the Links section of Rank Math plugin instead, the archive pages for my child category correctly appeared under the /parent-category/child-category/ structured URL. There’s a similar option available in the Yoast SEO plugin to get rid the category prefix under Search Appearance > Taxonomies settings called ‘Remove the Categories Prefix‘.

Strip Category Base option on Rank Mah

Don’t use a dot in the WordPress Permalink settings for Category Base field. Instead, use Rank Math or Yoast’s option to Strip Category Base

I hope this helps anyone who may have come across this issue and was left scratching their head as to why their child category, following their hierarchy parent/child category permalink structure, was not displaying posts on their child category archive page.

 

Steph Andrusjak

Steph Andrusjak

SEO Specialist

Freelance SEO consultant based in the United Kingdom.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

DISCLOSURE
Some links on this website are affiliate links. If you purchase from one of these links, I may receive commission at no extra cost to yourself. This helps to support the work I do and to continue to provide helpful content. Thank you.

Publer Social Media Tool

Rank Tracker with SE Ranking



Opera browser