The short meta description on the product….

  • Resolved Brid

    The short meta description on the product page (in global settings) does not work. Works only for title …

    Examples: Title & Meta> Product> Single Product Description (does not work) – Not visible on the product page

    Examples: Title & Meta> Product> Single Product Title (work)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Brid,

    Thanks a lot for your query and we are so sorry about the trouble this must have caused.

    Have you added a product description to the product already?
    product description

    Once you add that, Rank Math will pick that and set your product’s meta description like that.

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

    Here’s the problem ….

    Hello,

    Below is the sequence which Rank Math uses to generate the description:

    1) The Description text added in the Description field
    2) If text is not added in the Description field then the plugin will use excerpt/short description
    3) If the short description field is also empty then plugin will use the value added in the Settings.

    If you want Rank Math to use the value from step 3 instead of 2, then please add below filter code in your theme’s functions.php file:

    
    add_action( 'rank_math/frontend/description', function( $description ) {
    	global $post;
    	$desc = RankMath\Post::get_meta( 'description', $post->ID );
    
    	if ( ! $desc ) {
    		$desc = RankMath\Helper::get_settings( "titles.pt_{$post->post_type}_description" );
    		if ( $desc ) {
    			return RankMath\Helper::replace_vars( $desc, $post );
    		}
    	}
    
    	return $description;
    });
    

    Hope that helps. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this ticket.