• Hi,

    When I use the Structured Data Testing Tool of Google to check my website, I have the following error :

    Error : Missing required field “updated”.

    How can I fix this Error?

    Regards CanaC

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello CanaC,

    I just finished corrected my site.

    I created a file “functions.php” in my child theme with this 2 fonctions (mod content and add hatom data) :

    //mod content
    function hatom_mod_post_content ($content) {
      if ( in_the_loop() && !is_page() ) {
        $content = '<span class="entry-content">'.$content.'</span>';
      }
      return $content;
    }
    add_filter( 'the_content', 'hatom_mod_post_content');
    
    //add hatom data
    function add_mod_hatom_data($content) {
        $t = get_the_modified_time('F jS, Y');
        $author = get_the_author();
        $title = get_the_title();
        if(is_single()) {
            $content .= '<div class="hatom-extra"><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_mod_hatom_data');

    You can find the detailed solution here :

    http://www.davidtiong.com/fix-hatom-microformats-at-least-one-field-must-be-set-for-hatomentry

    You can also add the functions directly in the functions.php file of your theme but you could loose your modifications in case of an update of the Mantra theme.

    I hope this will help you.

    Valérie, France
    PS : please excuse my poor English

    Hi I also used this code, however this does not affect the static pages on my site.
    anyone fond a solution for the static pages?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Error : Missing required field "updated"’ is closed to new replies.