Single Product Description

#612273
  • Resolved Anonymous
    Rank Math free

    Hello

    Been trying to edit the Single Product Description on Titles & Meta but it wont work.

    if I edit on single product page it works fine, but when I want to have it fixed for all products it does not work.

    Thanks
    please advice

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.

    Please note that 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 page

    To force the use of the description you have set in Global product settings (Rank math > Titles & meta) you can 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;
    });

    You may refer to this guide on how to add filters to your website: https://rankmath.com/kb/wordpress-hooks-actions-filters/

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

    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 Description’ is closed to new replies.