diff --git a/php/YoastSeoSchemaController.php b/php/YoastSeoSchemaController.php index efd9037..22ea67a 100644 --- a/php/YoastSeoSchemaController.php +++ b/php/YoastSeoSchemaController.php @@ -47,6 +47,10 @@ public function maybe_add_expires( $data ) { return $data; } + if ( ! \post_type_supports( \get_post_type( $post_id ), 'expiration' ) ) { + return $data; + } + $data['expires'] = $expiration_date->format( \DATE_ATOM ); return $data;