How to Hide Prices From Google In WooCommerce

WooCommerce Hide Prices from GoogleGoogle is a powerful organization when it comes to product searches. Google beats out Amazon in product search reach. Moreover, it is worth mentioning that many online purchases start with a Google search. Google uses rich snippets, and that is why it excels at product searches.

Rich snippets give shoppers the ability to see products relevant to their search. Additionally, they can read reviews and compare prices from one place. Rich snippets act as a complete product encyclopedia. Therefore, your online store needs to get on the Google rich-snippet bandwagon.

If you are aspiring to be an online store owner, WooCommerce is your best bet. This is because the WooCommerce plugin is developed with SEO in mind. This means that it provides your website with the schema markup for products and other microdata useful for search engines.

WooCommerce Hide Prices from Google

By default, the schema markup displays the product price on Google’s search results. Moreover, data such as review stars, stock status, and the number of reviews are displayed.

However, you might want to hide the WooCommerce product prices from Google search results in certain cases. In this tutorial, you will see how it is easy to hide the prices using a custom PHP code snippet. Moreover, this solution will hide the prices on all search engines.WooCommerce Price in Google search engine

This solution will work for you if you want to display your prices until potential customers go to your website. This ensures that potential customers do not make a price-only decision, as they will also see the benefits of the product in the description.

Steps to Hide Prices From Google

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. 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.
  3. 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' );
  1. Click on the Save changes button at the bottom of the text editor screen.
  2. 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. However, if you want additional functionality, I recommend using a Schema Plugin. If you are not comfortable with handling code, please contact a qualified WordPress developer. This will ensure that you do not break your site.

Similar Articles