Alhamdulilah I am back to work and free from those terrible exams. I am calling them terrible because they really were! :P Just like the new errors in Blogger appearing everyday, it has become difficult to find and fix all of them but this is error is a one that was causing issues for over a year and every blogger was scratching his head that why was Blogger showing not one but two meta descriptions both on the homepage and posts. Google Webmaster Tools had also been showing duplicate meta description error for blogger Homepage and individual post pages. Simply go to your blog and press CTRL + U to open your blog's source file and then you will find two meta descriptions for the same page. One somewhere below the <head> tag and one just above <title> tag. This problem of the double occurrence of the meta tags started just last year when Blogger introduced Search Preferences so that bloggers could add a dynamic description to every post that they publish. This option is present in Blogger's Post Editor named as "Search Description".Credits
This problem was fixed some days back by my friend Mohammad who is one of the best bloggers and blogs at MyBloggerTricks. All credits are owned by him. If you wish to share this tutorial, then kindly link back to him and this page.Fix Duplicate Meta Description Error
- Check out: What is Meta Description?
Just follow these simple steps:
- Go To Blogger > Template
- Backup your template.
- Click the Edit HTML button.
- Search for the following code:
<b:if cond='data:blog.metaDescription != ""'>
<meta expr:content='data:blog.metaDescription' name='description'/>
</b:if>
Note: If you don't find the above code, then just relax and simply follow step 5
5. Now replace the above code with following chunk of codes:
<b:if cond='data:blog.url != data:blog.homepageUrl'>
<b:if cond='data:blog.pageType != "item"'>
<b:if cond='data:blog.metaDescription != ""'>
<meta expr:content='data:blog.metaDescription' name='description'/>
</b:if>
</b:if>
</b:if>
Note: Those who couldn't find the code in step 4, don't worry and simply copy the above code (in step 5) and paste it just below <head> tag.
- The purple code will disable duplicate occurrences of the descriptions on homepage.
- The green code will disable duplicate occurrences on of the descriptions on Post Pages.
Now visit your homepage or any post page and click CTRL + U to check its source file. You will find only one occurrence of meta description. :)
0 comments:
Post a Comment