Meta Description Being Ignored In HTML

#307171
  • Resolved Craig Blackman
    Rank Math free

    Hi there,
    We have a WooCommerce site. We have set the Single Product Description Meta Description under Dashboard > Rank Math > Titles & Meta > Single Product Description to:
    %title% – %wc_sku% available to order today for just %wc_price%. We have over 200 excellent rated reviews and are NAFD Members.
    Yet, this is not being reflected in the HTML.
    What have I done wrong or is this a bug?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Prabhat
    Rank Math agency

    Hello,

    Thank you for contacting us and we regret the inconvenience caused.

    I tried to check the page but the access was blocked by WordFence. You can have a look at the screenshot in the sensitive data section of this ticket.

    If you’ve enabled geo-blocking, then please exclude India, Portugal, and the Philippines, so that we can investigate further.

    Looking forward to helping you.

    Thank you.

    Craig Blackman
    Rank Math free

    Hi Prabhat,

    Please take another look now, I have temporarily allowed traffic from these locations

    Many Thanks

    Hello,

    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 variable in the Titles & Meta, adding a short description will override that. You can use the filter given below to make the Titles & Meta first priority to fetch the description:

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

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

    Craig Blackman
    Rank Math free

    Nice one, thanks Jaideep 🙂

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

The ticket ‘Meta Description Being Ignored In HTML’ is closed to new replies.