Title: Missing field &#8220;priceValidUntil&#8221; (optional)
Last modified: August 4, 2021

---

# Missing field “priceValidUntil” (optional)

 *  Resolved [karamba](https://wordpress.org/support/users/karamba/)
 * (@karamba)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/)
 * At the rich results testing tool I’ve seen this error (Missing field “priceValidUntil”(
   optional))
    Its only 1 error across all pages and I’d like to fix it. The thing
   is I have regular price only (no sale, no offers) so why its wrong?..
 * `"...offers":[{"@type":"Offer","price":"199.00","priceSpecification":{"price":"
   199.00","priceCurrency":"THB"},"priceCurrency":"THB","availability":"http://schema.
   org/InStock"...`

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Md Mazedul Islam Khan](https://wordpress.org/support/users/mazedulislamkhan/)
 * (@mazedulislamkhan)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14732703)
 * We are afraid to say that Yoast SEO doesn’t add the `priceValidUntil` schema 
   property. You’ll need to have [Yoast WooCommerce SEO](https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/)
   to have the relevant schema property. Further information can be found here: 
   [https://yoast.com/help/how-to-fix-missing-schema-property-missing-field-pricevaliduntil/](https://yoast.com/help/how-to-fix-missing-schema-property-missing-field-pricevaliduntil/)
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14753318)
 * We are going ahead and marking this issue as resolved due to inactivity. If you
   require any further assistance please create a new issue.
 *  Thread Starter [karamba](https://wordpress.org/support/users/karamba/)
 * (@karamba)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14817097)
 * RankMath have a following temp solution:
 *     ```
       /**
        * Filter to modify Rank Math product schema data
        * Replace $schema_type with schema name like article, review, etc.
        * @param array $entity Snippet Data
        * @return array
        */
       add_filter( "rank_math/snippet/rich_snippet_product_entity", function( $entity ) {
       	$entity['offers']['priceValidUntil'] = '2050-01-01';
   
       	return $entity;
       });
       ```
   
 * How to do the same with Yoast?..
 *  Thread Starter [karamba](https://wordpress.org/support/users/karamba/)
 * (@karamba)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14821209)
 * This trick doesn’t help either
 *     ```
       add_filter( 'wpseo_schema_product', 'gbol_reset_price_valid_until' );
       function gbol_reset_price_valid_until( $data ) {
       	global $product;
   
       	if ( ! empty( $data['offers'] ) ) {
       		foreach ( $data['offers'] as $key => $offer ) {
       			if ( ! isset( $offer['priceValidUntil'] ) ) {
       				$data['offers'][$key]['priceValidUntil'] = date( 'Y-12-31', time() + YEAR_IN_SECONDS );
       			}
       		}
       	}
   
       	return $data;
       }
       ```
   
 *  Plugin Support [Michael Tiña](https://wordpress.org/support/users/mikes41720/)
 * (@mikes41720)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14864384)
 * Hi [@karamba](https://wordpress.org/support/users/karamba/)
 * As mentioned, you’ll need the [Yoast WooCommerce SEO plugin](https://yoast.com/wordpress/plugins/yoast-woocommerce-seo/)
   to add the relevant `priceValidUntil` schema piece – [https://yoast.com/help/how-to-fix-missing-schema-property-missing-field-pricevaliduntil/](https://yoast.com/help/how-to-fix-missing-schema-property-missing-field-pricevaliduntil/)
 * Otherwise, you’ll need to refer to the Schema API in order to modify and add 
   to the default schema output – [https://developer.yoast.com/features/schema/api/](https://developer.yoast.com/features/schema/api/)
 *  [devnihil](https://wordpress.org/support/users/devnihil/)
 * (@devnihil)
 * [4 years, 8 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14889912)
 * We are marking this issue as resolved due to inactivity. If you require any further
   assistance please create a new issue.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Missing field “priceValidUntil” (optional)’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

 * 6 replies
 * 4 participants
 * Last reply from: [devnihil](https://wordpress.org/support/users/devnihil/)
 * Last activity: [4 years, 8 months ago](https://wordpress.org/support/topic/missing-field-pricevaliduntil-optional/#post-14889912)
 * Status: resolved