How to Fix hatom-feed warnings in Structured Data

Share This Post


Managing a Website and fixing errors is a full time job. There are many more things other than setting up a website and design it.

One has to keep checking for the errors as they can harm the website rankings in Search Engines. Similar thing happened with me few days ago.

When I logged into the Google Webmaster Tools, I saw there were so many errors in the Structured Data tab which looked something like this. image

Structured data is the information formatted in a manner that a Search Engine can understand and how in the search results. And all my webpages were showing the same errors,

I used the Structured Data Testing Tool from Google to find out the errors the pages were showing. These were mainly three fields were missing.

Warning: At least one field must be set for HatomEntry
Warning: Missing required field “entry-title”.
Warning: Missing required field “updated”.
Warning: Missing required hCard “author”.


As the error is showing for all the pages, it means that the these fields are missing in the single page ( mainly single.php in the themes).

[note]Important: Make sure you keep a backup of the file you are editing. If anything goes wrong, you can upload the file back using an FTP client.[/note]

Fixing “entry title” 

“entry title” displays the Title of the field, You can class the title with this tag

<h1 class="entry-title">Page Title</h1>

If you are looking for the codes in Twenty Fourteen Theme, you can find them in content.php. They already use “entry title” for their post titles. View this image.
Your theme might be using a different class to display the title. You can simple add the “entry title” like this,

<h1 class="single-title post-title entry-title" itemprop="headline"><?php the_title(); ?></h1>

I have used the above code in one of my own blogs, which are using a different class tag. I just added the “entry title” tag to the existing class and it worked. View this image.

Fixing “Updated”

Every post contains publishing date, the saturated data looks for “date updated” tag to get the date. So you can add this code to fix this.

<span class="date updated"><?php echo get_the_date();?></span>

Now, your theme might be using a different class to display date on posts, so you can put this “date updated” tag like this,

<p class="meta date updated"> <time datetime="<?php echo the_time('Y-m-d'); ?>" ><?php the_time('m/d/Y'); ?></time>, <span class="vcard author"><span class="fn"><?php the_author_posts_link(); ?></span></span></p>

 Fixing “Author”

The Structured data needs the Author of the post, you need this tag “vcard author” and “fn” tag.

<span class="vcard author">
<span class="fn"><?php the_author(); ?></span></span>

You can find the code that is pulling author’s name in your theme and enclose it with these tags like this, 

<span class="vcard author">
<span class="fn"><?php the_author_posts_link(); ?></span></span>

So now,

When you add these three elements in post template of your theme, you will see no errors in the Structured Data Tool Test.




Related Stories


13 Stunning Handpicked WordPress Themes for a Tech Blog

At Asiogroup, we keep showcasing WordPress themes with Great...

How to Move A YouTube Channel from One Google Account to Another

In this post, we will be talking about how...

WordPress 5.5 – What Changes this new Version brings to WordPress? is a blog about starting an online business,...
- Promotional Offer -spot_img