Silo Your Content

I’ve done some really fun work with the folks at Nav43 doing some small websites and some large builds on WordPress & WooCommerce. One of the things that came up when they did their SEO audit was a way of “siloing content” – meaning anything that’s a blog article under “/blog” and anything to do with a WooCommerce store under “/store.” By default, everything WooCommerce creates is held under “/store” URI, but with blog articles, it wasn’t that easy. We wanted a structure similar to this:

  • /blog – Blog Main Page
  • /blog/category-name – Category Archive
  • /blog/category-name/post-name – Post Single

After much head banging and research and trying different plugins, I finalized my solution.

In your WordPress install, go to your Permalinks Settings Page. In the post permalink structure, enter

/blog/%category_name%/%post_name%

For your category base, just put in “.” (a period, without the spaces).

You will need to add some code to get this all to work nicely. In your theme’s functions.php file (or if you want to get fancy, you can roll your own plugin), use this code snippet:

function change_term_links( $url, $term, $taxonomy ) {
    if ('category' == $taxonomy) {
        return home_url('/blog/'. $term->slug.'/');
    }

    return $url;
}

add_filter('term_link', 'change_term_links', 1, 3);

That should do it. All your blog content should be nice ans nestled into the /blog subfolder of your WordPress website. Mind you, it’s been a while since I used this (6 months, roughly), so it might need tweaking if the latest WordPress versions broke the Category Base hack.

Leave a Reply

Your email address will not be published. Required fields are marked *