title: How to replace variable price with Lowest price for google snippet
body: <p>On our website, our theme has provided a dedicated option to disable the variable price ($$-$$$). Only lowest price is displayed or the price of the variation when selected.</p>
  <p>This works like a charm.</p>
  <p>But these settings are not applied to search engine snippets.</p>
  <p>Price on web listing (google) appears as $87 – $700. We do not want to display this range. Only lowest price. In this case $87.</p>
  <p>How to achieve this for all search engines?</p>
  <p>I originally asked this question at Rank math forum. They probably provided the solution. However I am no longer using Rank math. I switches back to Yoast. Now how do I solve this?</p>
  <p>This was the code below</p>
  <pre><code>add_filter( 'rank_math/snippet/rich_snippet_product_entity', function( $entity ) {
      if ( empty( $entity['offers'] ) || 'AggregateOffer' !== $entity['offers']['@type'] ) {
          return $entity;
      }
      $entity['offers']['price'] = $entity['offers']['lowPrice'];
      $entity['offers']['@type'] = 'Offer';
      unset( $entity['offers']['lowPrice'] );
      unset( $entity['offers']['highPrice'] );
      unset( $entity['offers']['offerCount'] );
      return $entity;
  });
  </code></pre>
  <p><a href="https://wordpress.org/support/topic/replace-variable-price-with-lowest-price-for-google-snippet/" rel="nofollow noreferrer">Rank math post link</a></p>