-
I’m currently using the RankMath JobPosting schema and utilizing the %date(Y-m-dTH:i:sP)% shortcode to display the post date in the schema markup. Recently, I created a custom function to update only the post’s modified date, while keeping the original publish date unchanged.
I would like to know how I can modify the schema to display the post’s modified date instead of the publish date. Could you guide me on how to achieve this?
For this I’m using this code:
add_filter( 'rank_math/snippet/rich_snippet_jobposting_entity', function( $entity ) {
if(isset($entity['datePosted'])){
$entity['datePosted'] = get_the_modified_time('Y-m-dTH:i:sP');
}
return $entity;
});
It displays dateModified in schema but Now I want to display both datePosted and modifiedDate peoperty separately in JobPosting Schema. What should I do to get it done
The ticket ‘Add Date Property in JobPosting schema’ is closed to new replies.