Whether the following product architecture fields support variables

#823526
Viewing 8 replies - 1 through 8 (of 8 total)
  • Hello,

    The image you provided shows the product architecture fields in Rank Math for WooCommerce products. These fields do support variables. You can use variables to create dynamic content for your product pages, such as dynamic titles and descriptions.

    If you need assistance with using variables in these fields, please let us know so we can provide you with detailed guidance. Thank you for reaching out!

    Sources:
    General Tab in Meta Box of Rank Math SEO Plugin
    Using Variables in the SEO Title and Description » Rank Math
    How to Use Product Schema for WooCommerce Products » Rank Math

    Yes, I would like to know the filling of all product page field variables, please give me the detailed details

    Can I set the architecture of the product page to be the rankmath product Schema instead of the woocommerce product Schema

    https://snipboard.io/u7Fh5l.jpg

    Hello,

    Yes, you can use Rank Math variables in the schema generator here:
    https://rankmath.com/kb/variables-in-seo-title-description/#product-price

    If you have a custom value or stored it in a custom field for example, you may need to register it to use in the schema editor:
    https://rankmath.com/kb/variables-in-seo-title-description/#how-to-add-custom-variables

    Regarding the Schema Type in Titles & Meta, the Product Schema is not an option for your products since it is incomplete. We have integrated with WooCommerce so you can save filling in those details as it automatically fetches the data from your products and fills in the schema.

    If you wanted a custom Product Schema to be the default with variables, then you may need Rank Math PRO to create a Schema Template to achieve that:
    https://rankmath.com/kb/schema-templates/

    Hope that helps.

    Hello Reinelle,
    I need to add a shippingdetails field to the schema. How should I fill in and set this variable?

    https://snipboard.io/uWM0x1.jpg

    Hello,

    There is no variable for shipping details. Also, the Advanced Editor is only available in the PRO version and the account you have used to open this ticket is a free account. Please share the email address of your PRO account so we can verify your purchase and assist you further.

    Looking forward to helping you.

    Hello friend, the following is my member account, I found that our google search console account prompts missing shipping details, how should I set it without this variable?

    https://snipboard.io/3I1QZP.jpg

    Hello,

    To add those properties, you can edit the following filter with the appropriate data for these properties so it gets included in the Product Schema as well: https://rankmath.com/kb/filters-hooks-api-developer/#change-post-schema-data

    We have created an example filter that would help add this data and it assumes that the refund policy is only applicable to the USA and that it has a 30-day refund period.

    The shipping rate section also assumes a flat fee of 5$ to ship within the United States.

    This would need to be changed according to the website specifications but it should be a good starting point:

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

    Here is a guide you can follow to add the filter:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Looking forward to helping you.

    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 8 replies - 1 through 8 (of 8 total)

The ticket ‘Whether the following product architecture fields support variables’ is closed to new replies.