Using All in One SEO for WooCommerce Product Shipping and Return Policy Schema

Structured data (also known as Schema markup)  is crucial in how search engines understand and display your content. Providing detailed product schema for eCommerce websites using WooCommerce can significantly enhance search engine visibility and improve click-through rates.

Adding comprehensive shipping information and merchant return policy data to your product schema gives potential customers valuable information directly in search results.

This guide will walk you through enhancing your WooCommerce product schema using All in One SEO and explain the benefits of adding detailed shipping and return policy data.

Benefits of Adding Detailed Shipping and Return Policy Data

Enhanced Search Listings

  • Rich Snippets: You’ll get more eye-catching product listings in search results, which can boost click-through rates.
  • Higher Click-Through Rates: Detailed and transparent shipping and return policies can make your listings stand out, leading to more clicks than standard listings.

Improved SEO

  • Schema Compliance: Staying up-to-date with the latest schema.org standards helps search engines better understand your content.
  • Search Engine Favorability: Sites with comprehensive and accurate structured data often receive better visibility and rankings.
  • Improved Search Engine Visibility: Rich snippets that include shipping and return policy details can increase your chances of appearing prominently in search results.

Better Customer Experience

  • Transparency: Clearly communicating shipping costs and return policies upfront shows customers you’re committed to honesty and reliability.
  • Reduced Cart Abandonment: When buyers know exactly what to expect, they’re less likely to hesitate at checkout.

Increased Trust and Transparency

  • Higher Conversion Rates: Detailed policies build confidence and peace of mind, encouraging customers to follow through with their purchases.
  • Customer Reassurance: Clear, straightforward shipping and return details demonstrate a customer-focused approach, which can foster loyalty.

Competitive Advantage

  • Stand Out from Competitors: Not all e-commerce sites offer this level of detail, so including it can help your business shine in a crowded marketplace.
  • Build Trust: Showcasing professionalism and attention to detail can separate you from others and attract more buyers.

Compliance with Schema.org Standards

  • Latest Algorithm Compatibility: Keeping your structured data updated ensures search engine algorithms understand your site correctly, improving overall performance and user experience.

Here are the steps involved

Backup Your Website

Before making any changes, it's essential to back up your website. This ensures you can restore your site if anything goes wrong during the implementation.

Install the WPCode Plugin

  1. Navigate to Plugins > Add New in your WordPress dashboard.
  2. Search for WPCode.
  3. Install and activate the plugin.

Prepare the Custom Code Snippet

Below is the custom PHP code that adds shipping details and return policy information to your WooCommerce product schema:

add_filter( 'aioseo_schema_output', 'aioseo_add_shipping_details_and_return_policy' );

function aioseo_add_shipping_details_and_return_policy( $graphs ) {

    if ( is_singular( 'product' ) && aioseo()->helpers->isWooCommerceActive() ) {

        foreach ( $graphs as $index => $graph ) {

            if ( 'Product' === $graph['@type'] ) {

                if ( ! isset( $graphs[ $index ]['offers'] ) ) {

                    $graphs[ $index ]['offers'] = [];

                }

                $graphs[ $index ]['offers']['shippingDetails'] = [

                    '@type' => 'OfferShippingDetails',

                    'shippingDestination' => [

                        '@type' => 'DefinedRegion',

                        'name' => 'Worldwide',

                        'addressCountry' => 'US'

                    ],

                    'deliveryTime' => [

                        '@type' => 'ShippingDeliveryTime',

                        'handlingTime' => [

                            '@type' => 'QuantitativeValue',

                            'minValue' => 1,

                            'maxValue' => 2,

                            'unitCode' => 'd'

                        ],

                        'transitTime' => [

                            '@type' => 'QuantitativeValue',

                            'minValue' => 3,

                            'maxValue' => 5,

                            'unitCode' => 'd'

                        ]

                    ],

                    'shippingRate' => [

                        '@type' => 'MonetaryAmount',

                        'value' => '10.00',

                        'currency' => 'USD'

                    ]

                ];

                $graphs[ $index ]['offers']['hasMerchantReturnPolicy'] = [

                    '@type' => 'MerchantReturnPolicy',

                    'returnPolicyCategory' => 'MerchantReturnFiniteReturnWindow',

                    'merchantReturnDays' => 30,

                    'applicableCountry' => 'US',

                    'returnFees' => 'FreeReturn',

                    'returnMethod' => 'ReturnByMail'

                ];

            }

        }

    }

    return $graphs;

}

Customize the Code

Before adding the code to your site, customize it to match your business policies:

  • shippingDestination:
    • Modify ‘name' => ‘Worldwide' if you ship to specific regions.
    • Change ‘addressCountry' => ‘US' to the appropriate country code.
  • deliveryTime:
    • Modify minValue and maxValue in handlingTime and transitTime to reflect your actual times.
  • shippingRate:
    • Modify ‘value' => ‘10.00' to your actual shipping cost.
    • Change ‘currency' => ‘USD' to your currency code if different.
  • MerchantReturnPolicy:
    • Modify ‘merchantReturnDays' => 30 to your return window.
    • Modify ‘applicableCountry' => ‘US' if your policy applies to different countries.
    • Modify ‘returnFees' => ‘FreeReturn' if returns are not free.
    • Modify ‘returnMethod' => ‘ReturnByMail' if you accept returns differently.

Add the PHP Code Snippet Using WPCode

  1. Go to Code Snippets > Add Snippet in your WordPress dashboard.
  2. Click on Add Your Custom Code (New Snippet).
  3. Give your snippet a descriptive title, e.g., “Add Shipping and Return Policy to Product Schema“.
  4. Choose the Code Type as PHP Snippet.
  5. Paste your customized code into the code editor.
  6. Choose Auto Insert and select Run Everywhere.
  7. Click on Save Snippet.
  8. Toggle the switch to Active.

Test the Implementation

  1. Go to Google's Rich Results Test.
  2. Enter the URL of your product page.
  3. Analyze the results to ensure the new shipping and return policy data are present.

Enhancing your WooCommerce product schema with detailed shipping information and merchant return policy data is a strategic move that benefits both your SEO efforts and customer satisfaction.

While WooCommerce may not provide this functionality by default, using the All in One SEO plugin and a custom code snippet allows you to stay ahead of the curve.

By following this guide, you can implement these enhancements safely and effectively, ensuring your eCommerce site is optimized for search engines and users.