Open Pcosta88 opened 5 years ago
Hmm. I think this one is slightly different to #12156. If I'm reading this right, the challenge is:
"I have a product called 'red sock' in WooCommerce, categorised in 'footwear'. I want the title to be Red sock > Footwear | Brandname
".
In this case, %%parent_title%%
won't correctly return 'Footwear', but that's expected behaviour - this isn't a 'child post', it's a product in a category - so %%parent_title%%
isn't populated.
We have %%ct_product_cat%%
for WooCommerce categories; does that solve it?
@jono-alderson Nope.
1. Add a product category as a subcategory. In this example: Hats
2. Add the %%ct_product_cat%%
template variable
3.See that the parent product category fails to be outputted
Well, that should work, I think! Bug!
I think the %%ct_product_cat%%
is expected to output all the categories assigned to a product. Since we'd like to output the name of the parent product category in the title of the child category, a template variable like %%parent_title%%
should be used in this case. However, this variable seems to work only with pages not with taxonomies.
A similar feature request was submitted some time ago https://github.com/Yoast/wordpress-seo/issues/6527 but it was closed at that time.
Please inform the customer of conversation # 486296 when this conversation has been closed.
Please inform the customer of conversation # 551730 when this conversation has been closed.
+1 Sadly still not fixed, I've had this issue since 2020. For products, I set the SEO title something like (loosely translated): %%title%% - %%ct_product_cat%% | %%website title%%
This however outputs not the primary category, but ALL the categories that the product is assigned to. Imagine a (tile) product named "Box grey", being in the categories "floor tiles", "ceramic floor tiles", "concrete look tiles", "terrace tiles", "ceramic terrace tiles". The output of %%ct_product_cat%% is all those categories.
Hi @jan-caerels
As mentioned in our help center for the snippet variables, %%ct_product_cat%% will output all the categories that are selected for the product page separated by commas.. So the result you have noticed is an expected result.
This issue is about outputting the parent category name when the %%ct_product_cat%%
is used on a child product's category page and not on the product page.
Is your feature request related to a problem? Please describe.
Users want to output the parent product category in the title of a sub product category
Describe the solution you'd like
Users must manually enter in the parent product category. We should provide template variable for a parent product category.
Note, the parent title variable does not work: https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/.
why you think the feature request is something we should consider for the Yoast SEO plugins?
Improve UX and Content SEO