In Google Search Console under Search Appearance > Structured Data, I found many errors for my WordPress website. The errors were all the same, Missing: Updated.
This means that for each WordPress blogpost or article, that page did not have the updated microdata. So to resolve this error message, I had to add the missing updated field somewhere to each blog post.
The easiest method was opening my functions.php file within the theme directory and add this code to it:
function add_atom_data($content) { $t = get_the_modified_time('F jS, Y'); $author = get_the_author(); $title = get_the_title(); if (is_home() || is_singular() || is_archive() ) { $content .= '<div class="hatom-extra" style="display:none;visibility:hidden;"><span class="entry-title">'.$title.'</span> was last modified: <span class="updated"> '.$t.'</span> by <span class="author vcard"><span class="fn">'.$author.'</span></span></div>'; } return $content; } add_filter('the_content', 'add_atom_data');
What this code does, is adding a <span> within a <div> and add the microdata of that page to it. In my case, I did not want to show this extra information to the user, so I have hidden this div by using style=”display:none;visibility:hidden;”.
Thanks it worked !:)
Really fine, thanks very much
Thank you very much!
After some Google time, i found this working solution.
Regards, Danny WUD
It works for me.Thanks very much!
I am trying to add the code, hopefully it can work and solve problems on my site