-
Helo,
We put meta title for the product ” %title% %sep% %tag% %category% test test”The problem is that the tag and category do not persist.
You can see this example
https://www.loom.com/share/eec36608927b4711a4110595e06f27c6
-
Hello,
I’m sorry to hear that you’re experiencing issues with the meta title for your product. It seems that the tag and category are not persisting as expected. Thank you for providing the example link. I’ll be sure to look into this for you.
To resolve this, please navigate to the Rank Math plugin and access the “Titles & Meta” settings. From there, you can customize the template for the product tag archive titles and ensure that the variables for the tag and category are correctly included in the template.
If you need further assistance, please feel free to assign this ticket to a human agent using the available buttons, and we’ll be happy to help further. Thank you for bringing this to our attention.
Sources:
Rank Math ‘Titles and Meta’ Options and Settings
How to Optimize a Category Page » Rank MathHello,
Thank you for your patience.
1. In products, the variables
%tag%
and%category%
will not work since they are for your regular posts.In this case, you should use the
%term%
or%customterm(taxonomy-name)%
variables on your meta title.Here’s a link for more information about variables:
https://rankmath.com/kb/variables-in-seo-title-description/#current-term2. This is the order we follow to generate meta descriptions for WooCommerce products or product categories for that matter:
A. Content from the SEO Description field
If that is missing, then:B. WooCommerce Excerpt or Product Short Description
If that is missing, then:C. Template From General Settings in WordPress Dashboard > Rank Math > Titles & Meta > Products
If that is missing, then:D. Auto-generated Content from the product page.
However, if you want to force the use of the description you have set in Global product settings (Rank math > Titles & meta > Products > Product Category/Tags Description), please add the following filter:
/** * Use the Description from Global Setting, if the description is missing in the Post metabox */ add_action( 'rank_math/frontend/description', function( $description ) { global $post; $desc = RankMath\Post::get_meta( 'description', $post->ID); if ( is_product_category() || is_product_tag()) { $desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" ); if ( $desc ) { return RankMath\Helper::replace_vars( $desc, $post ); } } return $description; });
Here’s how you can add a filter/hook to your WordPress site:
https://rankmath.com/kb/wordpress-hooks-actions-filters/Please note that the description may not be visible while editing the products as it only works when your products load in a browser. Once done, clear your website’s cache and check the published product meta description via the page’s source code.
You can check the final output of the meta description here:
https://rankmath.com/tools/meta-tag-analyzer/3. To include the primary category of the product, please use this variable in the title field:
%customterm(product_cat)%
Once done, save the product and check the source code if it’s already showing.
Hope that helps.
Hello,
I have updated the sensitive data as requested. Can you please check further?
Thank you.
Hello,
1. regarding the meta title, we put this on the global options:
%customterm(pa_model)% %customterm(pa_product-type)% for %customterm(pa_gender)%: Stylish %customterm(pa_frame-style)% Frame in %customterm(pa_color)% with %customterm(pa_lens-color)% Lenses
but we don’t see it correctly on the product page, for example:
https://muunel.com/luca-uvallblue-women-blue-light-glasses2. I put the code on the theme file editor in the theme functions area regarding the meta description.
Then put this on the global option:
Explore Muunel’s %customterm(pa_model)% %customterm(pa_product-type)% for %customterm(pa_gender)%. Stylish %customterm(pa_frame-style)% frame in classic %customterm(pa_color)% with soothing %customterm(pa_lens-color)% lenses. Combat digital eye strain with fashion and function
But we don’t see it correctly on the product page, for example:
https://muunel.com/luca-uvallblue-women-blue-light-glasses, so you can check it from the backendAlso I added the site admin
Hello,
Thank you for your patience.
We’ve checked the product you have shared, and you have added a custom title and description upon editing that’s why they are not showing properly. Please refer to the screenshot in the sensitive data section.
To apply the meta title and description you have in Titles & Meta settings, the edit snippet values should be empty.
I have removed the title and description while editing the product, and they are already working fine.
Also, please note that the values will not show correctly in the editor. To ensure that the meta title and description you have set are already applied, you can verify that using these tools upon saving/publishing them:
https://heymeta.com
https://rankmath.com/tools/meta-tag-analyzer/Hope that helps.
Hello,
Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.
If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.
Thank you.
The ticket ‘Meta title’ is closed to new replies.