How To Show Edited Date Using Rich Snippet

Zshan

Supreme Member
Joined
Jun 28, 2012
Messages
1,478
Reaction score
406
Guys

Using rich snippet to show rating with stars in description but how can i show the edited date not the published date.? I am using thrive theme and Genesis. How can i do that so Google show the latest date not the published date in the description.

Really appreciate your help here
 
have you tried with this code:

<?php if(is_singular()): ?>
<?php global $post; ?>
<meta itemprop="dateModified" content="<?php echo get_the_modified_date( 'm-d-Y', $post->ID ); ?>">
<?php endif; ?>
 
have you tried with this code:

<?php if(is_singular()): ?>
<?php global $post; ?>
<meta itemprop="dateModified" content="<?php echo get_the_modified_date( 'm-d-Y', $post->ID ); ?>">
<?php endif; ?>

Can you please tell me where exactly i need to put this code?
 
I don't know your theme, anyway usually is /wp-content/themes/YOUR-THEME/header.php where YOUR-THEME is the theme's folder you are using.
You should put the code before </head>
such code should add a meta tag with 'date modified' in your posts, to comply with rich snippet directives.
Save the file (header.php) before to edit him, if something wrong re-up such file - I'm not responsible if you makes mistakes or such code do not work
 
Ok i am using pages instead of post so does it work or i need to change to page from post?
 
I think Yoast has that option to show the last edited date, do you use the Yoast plugin?
 
Guys

Using rich snippet to show rating with stars in description but how can i show the edited date not the published date.? I am using thrive theme and Genesis. How can i do that so Google show the latest date not the published date in the description.

Really appreciate your help here
which plugin you using for rich snippets?
 
Back
Top