WordPress subcategories, displayed with a simple shortcode
I built vfnl Subcategory Shortcode for websites where categories have their own subcategories, and visitors need a clear way to navigate between them. It adds a linked list of those subcategories to your WordPress category archive using one shortcode:
[subcategories]
The plugin checks which category the visitor is viewing and displays its direct subcategories. Each name links to the matching archive. You don’t need to maintain the links yourself or create a different shortcode for every category.
Add it once to your archive template
Suppose your website has a category called “Services”, with “Web Design”, “Hosting” and “Maintenance” underneath it. On the Services archive, the plugin displays links to those three subcategories.
Visit another category using the same archive template, and the list changes to show the subcategories belonging to that category. As you add or reorganise your categories in WordPress, the list follows that structure.
This is useful for blogs, knowledge bases and other websites where content is organised into several levels. Visitors can start with a broad subject and move towards the information they need.
A few options to make the list fit your website
You can use the shortcode as it is or adjust its attributes. The available options let you:
- Sort subcategories by name or post count.
- Display them in ascending or descending order.
- Hide empty categories or keep them visible.
- Add your own CSS class for styling.
For example:
[subcategories class="my-subcat-list" orderby="count" order="DESC" hide_empty="true"]
This displays non-empty subcategories, starting with the highest post count. The custom CSS class gives you a way to style the list within your theme.
By default, the plugin sorts subcategories alphabetically and includes empty terms.
Works with categories and other hierarchical taxonomies
Although the name refers to subcategories, the plugin also works with other WordPress taxonomies that have parent and child terms. It uses the taxonomy of the archive currently being viewed.
It displays one level at a time: the direct children of the current term. That keeps the list focused on the next step in your content structure.
Add the shortcode to a category or taxonomy archive template wherever your theme or page builder renders shortcodes. It needs that archive context to know what to display, so placing it on an ordinary page won’t automatically produce a category list.
Help visitors find related content
A useful category structure should also be easy to navigate. Showing subcategories on an archive gives visitors a direct route to more specific subjects, without making them search through your main menu.
Those links also connect related archive pages within your website. That can support your internal linking structure, although the plugin itself doesn’t manage SEO settings or guarantee better search rankings.
Settings, updates and support
The settings page contains the shortcode instructions, an explanation of each option and an example to get started. Licensing is handled in a separate tab, where you can connect your website for eligible updates and support.
Your existing subcategory lists keep working if the licence expires. The licence covers update and support access; it doesn’t switch off the navigation you’ve already added to your website.