WordPress /category/subcategory 404 error

I am new at WordPress and I would like to create a url structure for a recipe site.

/category ( eg: /recipe will list all recipes ).

Read More

/category/subcategory ( eg: recipe/chicken list of chicken recipes )

/category/subcategory/postname ( eg: recipe/chicken/Chicken-Breasts-with-Tomatoes

The problem:

When I access /category/subcategory ( /recipe/chicken ) i got 404 not found, but if i access /subcategory ( eg: /chicken ) it works.

I had marked the category “recipe” as the parent of chicken.

Tks a lot,
enog

Related posts

Leave a Reply

5 comments

  1. You can change your permalinks, adding some extension at the end:

    /%category%/%postname%.html
    

    I don’t like this solution much, but it makes subcategory pages work.

  2. I solved it by putting ‘en’ (short for English) as base for category. This kept the beauty of URL as well as do the job for me that I wanted. It also impacted SEO as search engine thinks of ‘en’ as ‘English’.

  3. /%category%/%subcategory%/%postname%/ works like a dream to see the excertps of the posts on the subcategory page!!!
    however it messes up the links to the posts
    if you change the wp-admin/options-permalink.php to just postname then it will work

  4. You can try using SEO tools for wordpress such as Yoast or Rank Math.

    These Seo tools offer a way for you to remove/strip the category base of your permalink structure.

    Just make sure to remove your first approach which was adding a dot(.) on the category base in the permalink page.