0

I am trying to have a permalink strucutre as follows:

/category [List all the posts for the category]
/category/child-category [List all the posts for the child category]
/category/post-slug

My permalink settings is as follows:

/%category%/%postname%/

The category base is blank.

But if I navigate to /category/child-category from the URL bar, the link 404s. It only works when I navigate to /child-category without the parent category from the URL bar.

What would I need to do to have the permalink structure that I am trying to accomplish?

  • What do you mean 'I go'? Do you type the URL in the address bar or you follow some navigation links? Please edit your question. Also, /category/child-category/post-slug/ is how it should work with your permalink structure. – Max Yudin May 17 '17 at 16:32
  • @MaxYudin I have clarified the question and removed the part about 'post' slug as I found out I could simply what I wanted by changing the Primary Category when selecting a category. – Niraj Pandey May 18 '17 at 8:06
0

I figured out why this was not working. I had to set the category base to a dot(.) without any plugins but since I had 'Yoast SEO' Plugin instead, I had the not set the correct settings. To achieve the permalink structure I required:

Without Plugin:

  1. Go to Setting > Permalinks
  2. Select Custom Structure
  3. Add /%category%/%postname%/ after your domain
  4. Change Category Base to period/dot.

With Yoast SEO plugin:

  1. Go to Yoast SEO
  2. Select advanced
  3. Click on the tab permalinks at the top
  4. Check Strip the category base (usually /category/) from the category URL.

Here is where is got those steps from (and some other ways to remove category base)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.