• Resolved Alexander

    (@donatory)


    Hello. Global Single Product Description from Rankmath settings does not work.

    Single products haven’t individual descriptions.
    Tried on different websites.
    The same feature works fine on posts.

    Steps to reproduce:

    1. Go to Rank Math SEO -> Titles & Meta -> Post Types: Product;
    2. Add some text to Single Product Description;
    3. Check product meta description. It should look like in global template.
Viewing 1 replies (of 1 total)
  • Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @donatory,

    Thank you for contacting Rank Math support.

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

    Here is how to add a filter to your site: https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

Viewing 1 replies (of 1 total)

The topic ‘Global single Product description doesn’t work’ is closed to new replies.