-
I configure rank math and I can’t modify the meta description of my products. I would like to replace the basic meta description by the description of their category. How can I do it?
-
Hello,
Thank you for contacting Rank Math and bringing your concern to our attention. I’m sorry for any inconvenience this issue may have caused you.
It seems that you’re using the
%excerpt%
variable for your meta description of your product. This is the order we follow to generate meta descriptions for WooCommerce product: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 pageI would like to replace the basic meta description by the description of their category.
From what I did understand, you wanted to use the product category description for your single product description? (Please correct me if I’m wrong)
I hope that helps. Thank you, and looking forward to your update.
Hey I would also like to know the variable for displaying the product category description in the single product description. Currently the single product description has been set as %wc_price%, %excerpt%. I would also like to display the product category description right after the %excerpt%. Is there any variable that can allow me to do that? Currently I’m using this code to prioritise the global product meta settings instead of the default one.
add_action( 'rank_math/frontend/description', function( $generated ) { if ( ! is_product() ) { return $generated; } global $post; $desc = RankMath\Helper::get_settings( "titles.pt_product_description" ); $desc = RankMath\Helper::replace_vars( $desc, $post ); return empty( $desc ) ? $generated : $desc; });
D’après ce que j’ai compris, vous vouliez utiliser la description de la catégorie de produit pour votre description de produit unique? (Corrigez-moi si j’ai tort, s’il-vous plait)
C’est exact, d’après votre réponse, j’utilise le bon chemin pour modifier cela cependant je ne sais pas que code mettre a la place de %excerpt% pour afficher la description de la catégorie du produit
Merci,
Hello,
Thank you for keeping in touch with us.
You can make use of this variable for your product’s meta description:
%customterm_desc(product_cat)%
. This should allow you to grab the description details of a product’s category and use it as your meta description.Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.
Thank’s
Problem reslolved
Hello,
We are super happy that your issue is resolved. 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.
The ticket ‘Change Meta Description’ is closed to new replies.