hasMerchantReturnPolicy and shippingDetails Error In GSC

#789495
  • Resolved Anonymous
    Rank Math free

    Q#1
    I did not install rank Math in WordPress so how I can resolve this if I installed Yoast plugin?

    Q#2
    If i have custom website how i can resolve it?

    Q#3
    Someone from your team share a code which we can use but their is the fix value for shipping detail, how i can create dynamic value?

    Here is the filter code:
    add_filter( “rank_math/snippet/rich_snippet_product_entity”, function( $entity ) {
    // Return policy
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘@type’] = ‘MerchantReturnPolicy’;
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘applicableCountry’] = ‘US’;
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘returnPolicyCategory’] = ‘https://schema.org/MerchantReturnFiniteReturnWindow’;
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘merchantReturnDays’] = 30;
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘returnMethod’] = ‘https://schema.org/ReturnByMail’;
    $entity[‘offers’][‘hasMerchantReturnPolicy’][‘returnFees’] = ‘https://schema.org/FreeReturn’;

    // Shipping details
    $entity[‘offers’][‘shippingDetails’][‘@type’] = ‘OfferShippingDetails’;
    $entity[‘offers’][‘shippingDetails’][‘shippingRate’][‘@type’] = ‘MonetaryAmount’;
    $entity[‘offers’][‘shippingDetails’][‘shippingRate’][‘value’] = 5;
    $entity[‘offers’][‘shippingDetails’][‘shippingRate’][‘currency’] = ‘USD’;
    $entity[‘offers’][‘shippingDetails’][‘shippingDestination’][‘@type’] = ‘DefinedRegion’;
    $entity[‘offers’][‘shippingDetails’][‘shippingDestination’][‘addressCountry’] = ‘US’;

    return $entity;
    });

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

    We apologize for the inconvenience you are facing with the errors related to “hasMerchantReturnPolicy” and “shippingDetails” in Google Search Console.

    1. If you have installed the Yoast plugin instead of Rank Math:
      If you are using the Yoast plugin and encountering these errors, you can refer to Yoast’s documentation or support for guidance on how to resolve these specific issues. Unfortunately, as a Rank Math support agent, I can only provide assistance related to Rank Math.

    2. For a custom website without Rank Math or Yoast:
      If you have a custom website without Rank Math or Yoast, you would need to manually implement the necessary structured data for “hasMerchantReturnPolicy” and “shippingDetails.” You may need to consult with a developer to add the required structured data to your website’s codebase.

    3. Creating dynamic values for shipping details:
      To create dynamic values for shipping details in the provided filter code, you would need to modify the code to fetch the dynamic values from your database or other sources. Here is a general approach:

      • Retrieve the dynamic values (e.g., shipping rate, currency, address country) from your database or settings.
      • Update the filter code to use these dynamic values instead of fixed values.
      • You may need to customize the code further based on how you store and retrieve the dynamic shipping details in your system.

    If you need further assistance or clarification on implementing dynamic values in the filter code provided, please reply here, and our team will assist you accordingly.

    Thank you for reaching out with your concerns. If you have any more questions or need additional help, feel free to ask.

    Sources:
    Rank Math SEO Filters and Hooks for Developers – Rank Math
    How to Fix Aggregate Rating Error » Rank Math
    Setting a Custom Brand for Your WooCommerce Store with Rank Math » Rank Math
    Google Search Console Missing Field Warning » Rank Math

    Anonymous
    Rank Math free

    Can you please guide me for implementing dynamic values for shipping details for custom website so that I can guide to my developer regarding theses things because he do not know about it. If I guide him properly I am sure he can perform this task.

    Hope you will help me.

    Thanks!

    ABID KHAN

    Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    That code you shared will fix the issue but since you mentioned that you don’t have Rank Math installed on your website, the code will surely not work.

    You should contact Yoast instead to implement the product schema issue since that is the plugin that is currently installed on your website.

    Yoast has a dedicated guide on how to resolve this specific issue: https://yoast.com/help/warning-about-missing-return-policy-info/

    Hope that helps and please do not hesitate to let us know if you need our 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 3 replies - 1 through 3 (of 3 total)

The ticket ‘hasMerchantReturnPolicy and shippingDetails Error In GSC’ is closed to new replies.