Single Product Meta Description – Template created

#462103
  • Resolved Allie McFadyen
    Rank Math free

    Hi there we have purchased Rank Math Pro for a website that we are about to launch (so it’s still on staging site at this point). Link below. I created a template for the single products on the site using the RM Meta Titles & Descriptions – Single Product Description. But when I look at the source code it is using the content within the product short description still?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math support, and sorry for any inconvenience that might have been caused due to that.

    You mentioned that you are using the PRO version and it seems you have created this ticket using your Free Rank Math account. Can you please forward the email address you used to purchase the subscription so we can verify it first?

    To address your issue: This is the order we follow to generate meta descriptions for WooCommerce products or product categories 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.

    However, if you wanted to force the use of the description you have set in Global product settings (Rank math > Titles & meta > Products > Single Product Description), please add the following filter to your active theme’s functions.php file:

    /**
     * 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. Once done, clear your website’s cache and check the published product meta description via the page’s source code.

    I hope that helps.

    Thank you.

    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 1 replies (of 1 total)

The ticket ‘Single Product Meta Description – Template created’ is closed to new replies.