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 ).
/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
You can change your permalinks, adding some extension at the end:
I don’t like this solution much, but it makes subcategory pages work.
The only thing that work for me was /%category%/%subcategory%/%postname%/ but it a little bit messy with the new posts that you create.
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’.
/%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
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.