Archived topic
missing updated time
9 replies · Started by david on April 12, 2017
hello! i just bought this premium features and on my way to customize.
i am asking for displaying date to visitor but not google here
with code you give, here's my date displayed,
before 
after 
i want to keep before for visitor information. how can i do that?
Hi David,
I believe I answered your question here: https://wordpress.org/support/topic/remove-date-from-serp-2/#post-9021426
Let me know :)
yes tom, but after i implement your code the after works, i still want the before work (posted on and update on displayed)
Ah, try this:
add_filter( 'generate_post_date_output','tu_remove_date_microdata' );
function tu_remove_date_microdata() {
$time_string = '<time class="entry-date published">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string .= '<time class="updated">%4$s</time>';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
printf(
'<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
$time_string
);
}
i merge the codes you gave to me before and it works. thank you.
You're welcome :)
Hello Tom,
Google Searchconsole is telling me, that all my pages related to pictures and from my implemented glossar plug does not show microformat updated. error: "following missing: updated"
Number is increasing and is starting since I am using your theme.
Examples are this page
https://www.ledclusive.de/blog/lighting-passport-von-asensetek-im-test/china-led-spectrometer-lighting-passport-spektrum/
Any idea, what I can do?
Have you turned off the post date/author in the Blog settings?: https://docs.generatepress.com/article/blog-overview/
Hello Tom,
yes, all items are switched on.
Must say, that at normal posts it works. only the posts created by the glossary plugin and picture pages as individuell link does not work.
Ah yes, the standard author/date is only added to the "post" post type. Any chance you can create a new topic on this as it's a different issue? I'll be able to help with some code :)