enog
enog

Reputation: 41

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 ).

/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

Upvotes: 4

Views: 3870

Answers (5)

Trek
Trek

Reputation: 1

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.

Upvotes: 0

Chaim Cohen
Chaim Cohen

Reputation: 1

/%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

Upvotes: 0

Sadaqatullah Noonari
Sadaqatullah Noonari

Reputation: 63

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'.

Upvotes: 0

Arsen K.
Arsen K.

Reputation: 5660

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.

Upvotes: 2

Nestor
Nestor

Reputation: 694

The only thing that work for me was /%category%/%subcategory%/%postname%/ but it a little bit messy with the new posts that you create.

Upvotes: 0

Related Questions