• Resolved etrarkia

    (@etrarkia)


    Hello,

    From Titles & Meta > Products > Single Product Description
    I generated and added tag for Custom Field:

    %customfield(about_description)%

    And when I check the Preview in each product page, I don’t get entered content from about_description field. Instead, I get content from Product Short Description which I don’t want to.

    Does anyone knows how to display the value from set Custom Field?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @etrarkia,

    Thank you for contacting support.

    Could you please check if the data is present in the actual page when you load it in the browser?

    Looking forward to hearing back from you.

    Thread Starter etrarkia

    (@etrarkia)

    Thanks for answering quickly.

    It is not.
    It displays content from Product Short Description field only.
    When I click at Edit Snippet, I can edit it, but as there are many products, it would took days to do it.

    What’s strange is when in Edit Snippet window I enter Custom Field tag that I used in Titles & Meta > Products > Single Product Description, it displays me the right content. Again, I’d have to enter manually into each product and Edit Snippet one by one.

    Do you have any suggestion maybe?
    Thanks!

    Plugin Support Rank Math Support

    (@rankmathteam)

    Hello @etrarkia,

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

    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 (long description)

    Since you are adding the variable in the Titles & Meta, your short description will override that. Please add the filter given below to add the description from the global settings. Please note that the filter will add the correct description in the front end but you will still see the short description in the snippet editor of the meta box.

    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; });

    Hope that helps. Let us know if you need any other assistance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Single Product Description with Custom Field – not working’ is closed to new replies.