Skip to main content

How to fix error 'At least one field must be set for hcard' and "name(fn)" in Blogger

Recently, I am using my webmaster account to check my all websites reports and get to know that my rich snippets showing errors like this,
Error: At least one field must be set for Hcard.
Error: Missing required field "name (fn)".
So, I decided to correct this error, normally in custom blogger templates, rich snippets problem occur due to incorrect structuring of template. I started googling but not found any solution for it, then, I started to read to rich snippet manual to find, What's the problem ?
I come to know that I made a childish mistake in my template and decided to publish here. So, that everyone can correct it. I found a lot of templates lacking with code shown in step 1 also, check if your template contains it or not and if not then, add it to your template.

Steps

1. Open your blogger template from 'edit html' in template sidebar on Blogger dashboard, search for post-header-line-1 and paste below code after it,
<span class='post-author hcard'>
<b:if cond='data:top.showAuthor'>
<data:top.authorLabel/>
<b:if cond='data:post.authorProfileUrl'>
<span class='fn'>
<a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
<data:post.author/>
</a>
</span>
<b:else/>
<span class='fn'><data:post.author/></span>
</b:if>
</b:if>
</span>
Note: In custom templates, it is possible that there are 2 post-header-line-1, paste the above code after the first one.

2. Now search for vcard in your template and replace all vcard with hcard.

3. And check your website with rich snippets.

I used this code on my template and its working correctly, but if you find any problem, get in touch with me by filling the comment form.

Comments