Meta Product

#80617
  • Resolved John Doe
    Rank Math free

    How do I set the priority for displaying a “description from the plugin settings” in a snippet instead of a “short description”?

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for contacting Rank Math today.

    If you are wish to use the description settings in Rank math > Titles & Meta > Product please add the following filter to your theme functions.php

    
    /**
     * Use the Description from Global Setting
     */
    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 will add the description in the front end/page source and not in Rank math preview.

    We hope that helps. If there’s anything else we can help you with, please let us know.

    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 ‘Meta Product’ is closed to new replies.