Sub Categories Not Pushing through to Child Sites - Just creates duplicate categories

I am publishing Custom Posts to child sites, which have a main category and a sub category.


Free (main category)

  • Breakfast (sub category)
  • Lunch (sub category)
  • Evening Meal (sub category)
  • Desserts (sub category)
  • Snacks (sub category)

Members (main category)

  • Breakfast (sub category)
  • Lunch (sub category)
  • Evening Meal (sub category)
  • Desserts (sub category)
  • Snacks (sub category)

However, I am encountering an issue where MainWP is creating the categories upon each submission of a new post, and making duplicates of them.

So I’m ending up with 1 recipe in desserts-members-2 (referring to the slug in the image), another in desserts-members-3, and so on. Instead there should be 7 recipes in desserts-members.

How the category listing should look.

It doesn’t do this if I just select a single 'main category’, only when I select ‘main category > sub category’.

Please can you advise.

This is how it should look

Hey @gemtech

Welcome to the MainWP community!

I’ve tried to replicate your setup. I’ve created two main categories and then two sub categories for each main category, but with the same names.

When creating a new CPT post, I encountered a bug, and I am curious if you are seeing this behavior. Namely, I would only see the sub categories of one main category:

This seems to be caused by the fact that sub categories have the same names, and when one of them is renamed to something unique, it shows up in the list:

However, I could not reproduce the issue you’ve originally reported.
When creating CPT posts under a subcategory, I did not get category duplication:

I see that in your image you have 1 item in SubCat1, 1 item in SubCat2, but only 1 item in MainCat1, is that because you did not select MainCat1 as the primary category when you posted it?

Then, another thing I notice is that your Custom Post Type may not be set up the same as I have checkboxes and not a lookup, so could it be to do with the configuration on the taxonomy? I have hierarchical = true , so the master site looks like this:-

But yes you seem close to replicating the issue because this is what I’m getting in my Category listing.


The problem with it is that the recipe pages are all designed to show different layouts based on whether the user is a member or not. If they are a member they get to see ‘Free’ MainCat posts and if they’re a Member, they get to see both ‘Free’ & ‘Member’ MainCat posts and my templates are designed to show or hide based on their category.

So I’m posting and nothing appears because all the recipes are assigned a category that doesn’t exist in the query.

I’m attaching a GIF below to see how it looks for me on the Dashboard site.

I have defined the categories only on the Child site, and I’ve done so under the standard Posts:

Then when creating the CPT Recipe post on the Dashboard site, it looks like this:

I have not done any changes to how categories are presented in the UI.

I think I can see the difference here now, your categories are coming from the ‘Generic Posts’.
However, when creating Custom Posts, you usually want Custom Post Categories as well.
So I have a Custom Post Taxonomy set up also. This is called ‘Recipe Categories’.

I have a video showing you a custom post type without a taxonomy called Test Recipes and then my original one called ‘Recipes’ with its Taxonomy of ‘Recipe Categories’.

Video here:-

I hope it makes sense what I’m showing/explaining in regards to the difference in your set up to mine. Thanks.

Thanks for making that video recording for us, @gemtech .

The reason why Categories aren’t populating in this moment is because you haven’t selected the child site:

As you can see in my gif, the category list is empty until I select at least one site:

I would assume that if you were to select a child site, the category list will populate by Generic Posts Categories.

I will have to check with the development team if our CPT extension is designed to handle such Custom Post Categories.

Hey @gemtech

I’ve checked with the development team.

Custom taxonomies should work with our extension so we will address that in the next release of our Custom Post Type extension.

However, it will still be necessary to first select a Child site and then their respective categories from the Categories widget below as seen here:

The difference will be that in the new version, custom taxonomies will be visible in that list.

The “Recipe Categories” widget visible on your MainWP Dashboard simply shows the custom taxonomies that are present on the Dashboard which does not play a role in how our extension works and will work in the next version.

Thanks Bojan,
Yes, this is correct. The Generic Post Categories will show up if I select a Child Site.

I have done a video showing exactly that. Where the ‘Recipes Categories’ custom taxonomy is visible on the ‘mainWP’ management site, but when selecting the Child Site, the only categories that can be selected is the ‘Generic post’ category, which are not used across any of our Child Sites.

Video Project 1.mp4

I look forward to the new update. Thanks.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.