How to Remove Date From Meta Descriptions in WordPress

Since I’ve changed my wordpress theme, I noticed that dates were being added in front of my meta descriptions in Google Search engine results page. Obviously, I first checked my source code as I thought it was my mistake, although all descriptions have been optimised correctly. I also thought that maybe those descriptions were too short/ long – that was not the case either…
Showing date in front of meta descriptions has its pros and cons though. When you update your blog very often (even a few times a day) and if you write news related posts, it is pretty useful from user perspective to know when the post was written. However, if you don’t write very often (like myself) and you cover non-news related content, showing the post date in SERP, can actually harm your Click Through Rate (CRT): First of all, the content is (usually) not fresh, secondly it does not look appealing. Therefore, I’ve decided to remove date from meta descriptions.
There are many different opinions how Google actually gathers those dates. Some of us say it is from RSS feeds or sitemaps, which might be true, although in my case the dates were taken from my blog posts.

Remove Date From Meta Descriptions- a simple solution

When I looked into source code in single.php, I noticed that automatically generated date has been included in a single div in the HTML header, just under the title, as below:
<div class=”post-meta-data”> Added <?php the_time(‘M j, Y’);?>, Under: <?php the_category(‘,’)?></div>
So what to do with this piece of annoying little code…
Google is not able to read pictures nor some javascripts, so if I don’t want Google to read the date, let’s put it into javascript and the job should done (at least for awhile).
Here is how I dealt with it:
<div class=”post-meta-data”> Added <script language=”javascript” type=”text/javascript”> document.write(‘<?php the_time(‘j’) ?>’); </script> <?php the_time(‘M Y’) ?> , Under: <?php the_category(‘,’)?> </div>
after which I resubmitted Sitemap.
When Google started crawling my pages and caching their new versions, viola! The dates for my posts Were GONE! Happy days:) (as I could not sleep because of that!)


0 nhận xét:

Post a Comment