Short Description to setup automatically as meta description in rank math

#478541
  • Resolved Usman Saleem
    Rank Math free

    Hi guys, currently i have 4000 products on my website. I just installed Rank math now. I can’t go to every product and setup meta description, so i just went and added the short description shortcode the plugin provides. But the thing is i want to only add specific lines from the short description. Which in my case is the first two lines, is it possible that i can do it? If its not possible can i able to add my product description text onto the meta description not by going to change for each and every product. Want to set it automatically. I will provide a sample product description and the short description so you can understand.


    <span style="color: #000000; background-color: gold; padding: 5px 10px; border-radius: 360px;">15,641 Orders</span>
    <div><span style="color: #1d9e11; font-weight: bold;">In Stock</span> <span style="color: #000000;">(Ships Out Within 24 Hours)</span></div>

    • Make delicious and beautiful Christmas treats using this Gingerbread House Cookie Cutter Set; it comes with four cookie cutters
    • Roll out your biscuit or cookie dough into a flat and thin sheet then use the cookie cutters to cut them out into different shapes
    • Use gum paste, icing, or any edible adhesive to connect the pieces together and form a gingerbread house
    • The cookie cutters are of food-grade plastic so they are easy to work with and simple to clean
    • Material: Food Grade Plastic
    • Dimensions:
      • Square Cookie Cutters: 6 x 4cm / 6 x 5cm
      • Pentagon Cookie Cutters: 9 x 7cm / 9.5 x 7.5cm
    • Package Contents:
      • 4 x Gingerbread House Cookie Cutters (2pc square cutters, 2pc pentagon cutters)

    ///////////
    Up above is my short description lets say i just want to use the first Li item for every product on my store is it possible?

    can i automatically use Product description as meta description and shorten it a bit?
    //////////////////
    Create the perfect gingerbread house for Christmas using this Plastic Gingerbread House Cookie Cutter Set! It comes with four cookie cutters! Simply spread out your cookie or biscuit dough and use the cutters to cut the dough out into different shapes. You can use the square cutters to cut out the roof and walls of the gingerbread house. Also, you can use the pentagon shapes for the front and back sides of the house. You can use icing or gum paste to put the pieces together and form a gingerbread house.

Viewing 15 replies - 1 through 15 (of 21 total)
  • 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.

    This is the order we follow to generate meta descriptions for WooCommerce products:

    1. Content from the 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 (long description)

    In this case, if you wanted to use the long description (product description you mentioned above) and shorten it a bit, you can use and modify this filter to create a custom variable for that:
    https://pastebin.com/FQRtjn68

    And here’s a guide on how you can add a filter to your website:
    https://rankmath.com/kb/filters-hooks-api-developer/

    After this, you can use the %woo_full_desc% variable in the SEO description or single product description field. You can then modify the number 160 in the filter to change the character limit.

    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/saved product’s meta description via its source code.

    You can also check the product’s meta description using these tools:
    https://www.heymeta.com/
    https://rankmath.com/tools/meta-tag-analyzer/

    I hope that helps.

    Thank you.

    Thanks that will help, also one question can i somehow globally set up this variable so automatically this variable is used for meta description for every product in my website without want to add it into specific products.

    Hello,

    Yes, you can use that variable in the global settings. Just make sure that you haven’t modified the meta description in individual product.

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Hi Jeremy i have tried adding the variable into the global field option but i don’t see it changing the post meta description when i go and edit post please tell me the path i am using the following page=rank-math-options-titles

    Hello,

    Could you please confirm if you’re still referring to products?

    If so, in Titles & Meta settings, click the Products on the left side panel and update the Single Product Description

    Single

    Hope that helps.

    Thank you.

    Hi I want to do it for both. I tried adding the same place you did add the variable for post and product but it’s not applying to every post and product on my website. I am using a snippet plug-in to create the variable. Please answer it soon I want my website live urgently thanks.

    Hello,

    Can you please share that variable here? Please note that Rank Math doesn’t support 3rd party plugins for the variables.

    If you prefer, we can check your website. Please edit the first post on this ticket and include your WordPress login in the designated Sensitive Data section.

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Hello,

    It seems that you are actually referring to the regular post types.

    We would like to test the filter code in the theme functions.php but we can’t seem to save the changes.

    Can you please try to move the code from the snippets plugin to your functions.php file to see if this would work? You may also clear your website cache after doing so.

    If the issue persists, please share your website FTP so we can check this issue further.

    Looking forward to helping you.

    Hi i have submitted the snippet code into the functions file still the same issue. I have updated the sensitive data with Sftp can check thanks

    Nigel
    Rank Math business

    Hello,

    I checked your website, and it does not have an active WooCommerce plugin. The code snippet only works with WooCommerce. Please may you share an example product page link so we can check if it is possible to adapt the solution to your website.

    Looking forward to helping you.

    I have tested with Woocoomerce it does not work. That is for my other website.
    Right now on the priority I want this snippet work for all of my posts meta description. Same functionality as the snippet is doing please find a solution to it thanks

    Nigel
    Rank Math business

    Hello,

    I checked your website and the %woo_full_desc% variable is working as expected in your posts. Please refer to the screencast in the sensitive data area.

    Hope that helps. Please let us know if you have questions.

    When i add manually as you added its working but how can i go to 90k posts on my website and edit each and every article variable? I want it to set it up automatically as the post description.

    Hello,

    We can see that the %woo_full_desc% seems to be working fine even without adding the variable to the individual posts. We however see that the preview shows %excerpt% instead.

    Kindly check the affected posts in the view source and see if the meta description has the correct information.

    Looking forward to helping you with this one.

    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.

Viewing 15 replies - 1 through 15 (of 21 total)

The ticket ‘Short Description to setup automatically as meta description in rank math’ is closed to new replies.