SkyVerge WooCommerce Extensions

This is probably another one of those situations that applies only to me, but just in case someone else out there happens to have this same broken permalink issue, I’ll describe what happened to my site, and how I fixed it.

The specifics of my setup were: WordPress 3.4.1, WordPress SEO 1.2.5, and the custom permalink structure /%category%/%postname%/. The problem that someone thankfully alerted me to (gotta get back in the habit of checking Google WMT regularly) was that my permalinks were broken. Specifically, sub-category or paginated permalinks such as /articles/magento/ or /articles/page/2/ either redirected to entirely the wrong page, or returned a 404. Post and page and WooCommerce URLs on the other hand worked just fine. Likewise, top-level category urls like /articles/ or /news/ were also unaffected.

Background

When I first set up this site I decided to structure my post permalinks so they would consist of any categories followed by the post title. Take for instance this very URL /articles/wordpress/wordpress-pretty-category-permalinks-broken-and-fixed/, it’s pretty clear that this is a WordPress article about fixing broken category permalinks. I feel like this structure results in a very intuitive and easy to navigate site, both for search engines as well as for users. To achieve this result I configured WordPress Settings > Permalinks: Custom Structure as /%category%/%postname%/.

Setting the Custom Structure gets you most of the way there, but despite leaving the category base blank, WordPress defaults it to ‘category’, meaning that rather than a nice permalink like say /articles/magento/how-to-upgrade-magento I get /category/articles/magento/how-to-upgrade-magento. Even worse than just having the extra directory level cluttering up my nice clean URL is the fact that the ‘category’ page doesn’t even exist: visiting /category/ returns a 404.

The solution is to use a plugin a remove that category base, there are a number of options available for this, I happened to use the one provided by WordPress SEO as I was using that plugin anyways. This can be enabled by going to SEO > Permalinks and checking the box next to “Strip the category base (usually /category/) from the category URL.” and gave me exactly the URL structure I was trying to achieve.

The Solution

And so the permalinks worked perfectly fine until recently, I suppose after updating WordPress SEO. After playing around with a backup of this site on my development machine for a few hours, I finally realized that all permalinks worked properly if I just included that default base category ‘category’. That is to say, /articles/javascript/ was a 404, but /category/articles/javascript/ was the Javascript archive page.

It didn’t take me much longer to remember and find that little WordPress SEO category base setting from oh so long ago. Knowing that sometimes permalink issues can be fixed by simply saving the WordPress permalink settings page, I went back to the SEO > Permalink page and saved the settings. That must have refreshed or regenerated the permalinks and fixed the problem.

Summary

The Problem

  • broken “pretty” category permalinks

My Environment

  • WordPress 3.4.1
  • Permalink Custom Structure: /%category%/%postname%/
  • WordPress SEO 1.2.5 to Strip the category base

The Solution

  1. Go to Settings > Permalinks and click “Save Settings”
  2. Go to SEO > Permalinks and click “Save Settings”

Published by Justin Stern

Justin is one of our co-founders, and is our resident overengineer. He likes to write developer tutorials and make black magic happen in our plugins. He thinks that writing code is a lot easier than writing words.

11 Comments

  1. wow!, that was the fix, thanks. I spent 1 day on this last week and ended up having to restore the db to the previous days backup. You have saved me loads of time. Thanks you.

    • You’re very welcome, happy to hear it saved someone else some time, I was pretty nervous when the navigation for my entire site was broken

  2. I have the exact same problem that arises and found the same solution you did of saving the settings to recreate the permalinks. My permalink structure is the same as yours without the trailing slash.

    Permalink Structure: /%category%/%postname%

    • Yeah, guess there are a bunch of us out there who had this problem. Glad you were able to fix yours, hopefully it didn’t take too much of your time either.

  3. I have the same problem, the categories and tags returned 404 errors
    my envirment is the same as yours :

    WordPress 3.4.1
    Permalink Custom Structure: /%category%/%postname%/

    when I trying to enable ‘Strip the category base’ in wordpress SEO to solve the problem but the website returned a ‘500’ error !

    • Hey Saad, unfortunately these permalink issues can be quite complex. Perhaps there’s another plugin entirely that’s causing issues? You could try disabling other plugins and see if you have a better result. Honestly we’re not even using that setup on our new site any longer, we’ve switched to /blog/%postname%/ which is perhaps a bit more stable.

  4. Hi… I am facing a small issue… Related to categories.. I am using Jarida theme… Everything was and is working fine except the category section. Couple of days back, i was testing WP Cache sort of plugins as well as JetPack. After installing them, my Categories would update in the Post Section but not in the Page. I have tried creating same categories by deleting older ones, or re-updating them; but its not working. My categories are showing accurately in the Post section while making post but not in the Add Page Section (old ones are still showing in bloglist template options). Its showing old created categories and not the new ones i create. Therefore, when someone views the specific page, posts related to that page are shown but irrelevant posts are shown as well. My website link is http://www.GoodHealthyWorld.com

  5. i hope ya reply soon…

  6. it was a cache issue… i have to completely clear my browser cache.. ridiculous on wordpress site… however am now facing new problem.. i checked my site http://www.goodhealthyworld.com for seo and found out that it has Canonical URL issue. the www and non www does not redirect to same place and thus my website content is getting duplicated.

    it was working fine but after installing plugins and much more, i ended up with these issues. one of many more…

  7. Hi Justin, I can not find my SEO tab settings.

Hmm, looks like this article is quite old! Its content may be outdated, so comments are now closed.