Need to remove product price from Google

#972230
  • Resolved Glenn Triepels
    Rank Math free

    Dear reader,

    We have a wholesale company and it’s important that website visitors cannot see the prices from our products. On the website the prices are only visible when logged in as a user. But Google is showing the prices of the product in Google SEO. Please see picture.

    null

    In the code I can see that this has something to do with Rankmath. Any idea how to fix?

    Looking forward receiving your reply.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    We apologize for the issue you are facing with product prices being displayed in Google search results. To prevent Google from indexing the prices on your website, you can use a couple of methods with the Rank Math SEO plugin.

    1. Use a Noindex Meta Tag

    You can add a noindex meta tag to the pages where the prices are displayed. This tells search engines not to index those pages. Here’s how to do it:

    • Go to the page or post where the prices are shown.
    • In the Rank Math meta box, under the Advanced tab, set the ROBOTS META to No Index.

    check the Rank Math noindex option

    For more details, refer to our guide on how to noindex URLs using the Rank Math SEO plugin.

    2. Edit Robots.txt File

    Alternatively, you can block Google from crawling specific files or sections of your site by editing your robots.txt file. You can add directives to disallow crawling of certain URLs that contain pricing information. Here’s an example:

    User-agent: *
    Disallow: /path-to-your-pricing-page/

    You can edit your robots.txt file using the Edit robots.txt option in the Rank Math plugin.

    Rank Math robots.txt feature

    3. Remove Prices from Schema Markup

    If you are using schema markup that includes pricing information, consider removing that data from your schema. This will help ensure that Google does not display prices in search results.

    Next Steps

    After implementing these changes, it may take some time for Google to update its index and remove the prices from search results. You can also use Google Search Console’s inspection tool to request re-indexing of your pages after making these changes.

    If you need further assistance or if there are specific technical issues on your site, please reply to this ticket with your site URL, and a human agent from our support team will assist you further.

    Thank you for raising this concern! We hope this helps you resolve the issue.

    Sources:
    How to Remove Images From Google Search Results » Rank Math

    Can you please inform me what easiest way to remove prices in Google? Important is that the rest of the information is still being indexed by Google.

    Hello,

    Thank you so much for getting in touch.

    Please note that removing the price from the product schema will render errors in the Rich Result so if you wish to remove that information for non-logged in users, you can simply use the following code:

    add_filter('rank_math/snippet/rich_snippet_product_entity', function ($entity) {
    	if(is_user_logged_in()){
    		return false;
    	}
    	return $entity;
    });

    Or, if you really want the price property to be removed, here’s a different code you can use:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
    	if (is_user_logged_in() && isset( $entity['offers'] ) ) {
    		unset( $entity['offers'] );
    	}
    	
    	return $entity;
    } );

    You can add this filter to your site’s functions.php file or use a custom plugin. If you’re not sure how to do that, please check out this tutorial: https://rankmath.com/kb/wordpress-hooks-actions-filters/

    Hope that helps.

    Glenn Triepels
    Rank Math free

    Hi,

    Many thanks for your reply. I don’t want to remove the price from the product page but it needs to be removed from Google Snippets. Please see image.

    Image snippet price

    Looking forward receiving your reply.

    Hello,

    The price that is shown on the search results page comes from the product schema.

    If you want to remove the price from the product schema, then you will need to add this filter to your site:

    add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
        if ( isset( $entity['offers'] ) ) {
    		unset( $entity['offers'] );
    	}
        return $entity;
    } );

    However, if you remove the price from the product schema, you will get this error on your product schema if you don’t have product reviews, which will invalidate it for snippets on the search results page:
    https://rankmath.com/kb/either-offers-review-or-aggregaterating-should-be-specified/#offers-review-aggregateRating

    To fix that, you may need to add at least one of them (price or review) so it will only return a warning (optional).

    Looking forward to helping you.

    Hi sir,

    Many thanks for your reply. Where do i need to add this code:?

    add_filter( ‘rank_math/snippet/rich_snippet_product_entity’, function( $entity ) {
    if ( isset( $entity[‘offers’] ) ) {
    unset( $entity[‘offers’] );
    }
    return $entity;
    } );

    And after adding this code you mean I need to add reviews to the productpages in order to not get any errors?

    Looking forward receiving your reply.

    Hello,

    You can apply the code/filter in any of the 3 methods we mentioned in this guide:
    https://rankmath.com/kb/wordpress-hooks-actions-filters/

    And yes, the error will be a warning only if they have reviews without price.

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

The ticket ‘Need to remove product price from Google’ is closed to new replies.