Google, a dominant force in product search, outperforms Amazon in product search visibility. Notably, numerous online buying journeys commence with a Google query, capitalizing on its proficiency in leveraging rich snippets for superior product search results.
Rich snippets offer shoppers the valuable capability to discover search-relevant products while also accessing reviews and price comparisons conveniently. These rich snippets serve as comprehensive product encyclopedias, making it imperative for your online store to embrace the Google rich-snippet trend. If you’re an aspiring online store owner aiming for optimal SEO, WooCommerce emerges as your top choice. WooCommerce, thanks to its SEO-centric design, ensures that your website benefits from essential schema markup for products and other valuable microdata that enhances search engine visibility.
WooCommerce Hide Prices from Google
By default, Google’s search results showcase product prices, along with essential data like review ratings, stock availability, and the number of reviews. Nevertheless, there are instances where you may wish to conceal WooCommerce product prices from Google search results. This step-by-step guide will demonstrate the simplicity of achieving this through a custom PHP code snippet. Furthermore, this solution applies universally across all search engines. If your goal is to present prices to potential customers only once they visit your website, this approach ensures that their decision-making process considers not just the price but also the product’s merits as detailed in the description.
Steps to Hide Prices From Google
Here are the steps that you need to follow:
- Log into your WordPress site and access the Dashboard as the admin user.
- From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file to hide Google prices.
- Click anywhere on the text editor and scroll to the bottom of the funcitons.php file. Paste the code at the end:
/**
* @snippet Hide Prices from search engines
*/
add_filter( 'woocommerce_structured_data_product_offer', '__return_empty_array' );
- Click on the Save changes button at the bottom of the text editor screen.
- Now you have successfully added the code snippet required to hide product prices from Google.
Conclusion
In summary, I have shared a custom PHP code snippet to hide product prices on all search engines.