Google 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.
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:
- 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. 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
- How to Remove Has Been Added to Your Cart Message WooCommerce
- How to Remove Cart Page WooCommerce Storefront Theme
- How to Hide Product Description Heading WooCommerce
- How to Remove or Disable Autop In WordPress Posts & Custom Post Types
- How to Limit WordPress Excerpt Length Like a Pro
- How to Display Dimensions of the Product Storefront Theme
- How to Redirect On Refresh WordPress Page » Detect Page Refresh PHP
- How to Hide Out of Stock Visibility In WooCommerce
- How to Add WooCommerce Storefront Sitemap
- How to Create One Product WooCommerce Storefront Store
- How to Hide Weight of Product in WooCommerce
- How to Change Font Storefront WooCommerce Theme
- How to Hide Price When Out of Stock In WooCommerce
- How to Hide Quantity In Stock In WooCommerce
- How to Check If Plugin is Active In WordPress [ 3 WAYS ]
- How to Hide Unavailable Variations In WooCommerce
- How to Hide WooCommerce Product from Search Results