• Resolved raha1988ab

    (@raha1988ab)


    Hello dear rankmath team

    How should I solve this issue?

    Search Console has identified that your site is affected by 2 Product snippets structured data issue(s). The following issues were found on your site.

    Top non-critical issues?
    Missing field "aggregateRating"
    
    Missing field "review"

    ?Non-critical issues?are suggestions for improvement, but do not prevent the page or feature from appearing on Google. Some of these issues can affect your appearance on Search; some might be reclassified as critical issues in the future.

    We recommend that you fix these issues when possible to enable the best experience and coverage in Google Search.

    https://prnt.sc/G-7Hiyah8nLU

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter raha1988ab

    (@raha1988ab)

    Top non-critical issues?
    Missing field "hasMerchantReturnPolicy" (in "offers")
    
    Missing field "shippingDetails" (in "offers")

    How to fix them? I’m using rankmath

    Search console generate new errors and I saw in my email address

    • This reply was modified 5 months ago by raha1988ab.
    Plugin Support Rank Math Support

    (@rankmathsupport)

    Hello @raha1988ab,
    ?
    Thank you for contacting Rank Math support.

    Please modify and use the following filter to add the shipping and return details to the Product Schema:

    add_filter( 'rank_math/json_ld', function( $data, $jsonld ) {    if ( empty( $data['richSnippet'] ) || ! in_array( $data['richSnippet']['@type'], [ 'Product', 'ProductGroup' ] ) ) { return $data; } $data['shippingDetails'] = [ '@context'     => 'https://schema.org/', '@type'        => 'OfferShippingDetails', '@id'          => '#shipping_policy', 'deliveryTime' => [ '@type'        => 'ShippingDeliveryTime', 'handlingTime' => [ '@type'    => 'QuantitativeValue', 'minValue' => 0, 'maxValue' => 1, 'unitCode' => 'DAY', ], 'transitTime' => [ '@type'    => 'QuantitativeValue', 'minValue' => 1, 'maxValue' => 5, 'unitCode' => 'DAY' ], ], 'shippingRate' => [ '@type'    => 'MonetaryAmount', 'value'    => 200, 'currency' => 'PKR', ], 'shippingDestination' => [ '@type' => 'DefinedRegion', 'addressCountry' => 'PK' ] ]; $data['hasMerchantReturnPolicy'] = [ '@context'     => 'https://schema.org/', '@type'        => 'MerchantReturnPolicy', '@id'          => '#merchant_policy', 'applicableCountry' => 'PK', 'returnPolicyCategory' => 'https://schema.org/MerchantReturnFiniteReturnWindow', 'merchantReturnDays' => 7, 'returnMethod' => 'https://schema.org/ReturnByMail', 'returnFees' => 'https://schema.org/FreeReturn' ]; if ( 'Product' ===  $data['richSnippet']['@type'] ) { $data['richSnippet']['offers']['shippingDetails'] = [ '@id' => '#shipping_policy' ]; $data['richSnippet']['offers']['hasMerchantReturnPolicy'] = ['@id' => '#merchant_policy']; return $data; } if ( empty( $data['richSnippet']['hasVariant'] ) ) { return $data; } foreach ( $data['richSnippet']['hasVariant'] as $key => $value ) { if ( empty( $value['offers'] ) ) { continue; } $data['richSnippet']['hasVariant'][ $key ]['offers']['shippingDetails'] = [ '@id' => '#shipping_policy' ]; $data['richSnippet']['hasVariant'][ $key ]['offers']['hasMerchantReturnPolicy'] = [ '@id' => '#merchant_policy' ]; } return $data;}, 99, 2);

    Here is how to add a filter to your site:?https://rankmath.com/kb/wordpress-hooks-actions-filters/
    ?
    Please do not hesitate to let us know if you need our assistance with anything else.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.