Hello,
Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.
Usually, this is the order we follow to generate meta descriptions for WooCommerce product for that matter:
1. Content from SEO Description field
If that is missing, then:
2. WooCommerce Excerpt or Product Short Description
If that is missing, then:
3. Template From General Settings in WordPress Dashboard > Rank Math > Titles & Meta > Products
If that is missing, then:
4. Auto-generated Content from the product page.
The fourth option is the reason why the description is showing in your product. If you do not want to show the description here you may want to use this filter to remove it: https://rankmath.com/kb/filters-hooks-api-developer/#change-meta-description
Hope this helps. Please let us know if you have any other questions.
We want to show %title% and our text
Hello,
Thank you for the update.
Could you please confirm if you wanted to show the product meta description you have set in Rank Math > Titles & Meta > Products instead of the product short description?
If so, you can use this filter instead to force the use of the meta description you have set globally for your products:
/**
* 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()) {
$desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
if ( $desc ) {
return RankMath\Helper::replace_vars( $desc, $post );
}
}
return $description;
});
Please note that the filter may not be visible while editing the products as it only works when your products load in a browser. You can check the published product meta description via the page’s source code. You can also check using this tool.
I hope that helps.
Thank you.
Thaks, but can we use the global description only in products?
Hello
Thank you for getting back to us.
By using this code it should only force the meta description you use in the global settings of your product’s post type.
This is the reason why we have included the if ( is_product())
section in the code to specifically target the products.
Hope this helps. Please let us know if you have any other questions.
Thank you.
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.