A little issue as removing dates from your blog’s search engine result listing can go a long way in improving your blog’s Click Through Rate from the search engines and in return can improve your traffic a great deal. In this tutorial, I’ll guide you on how you can easily remove dates from your Google search result snippets, but before that, let me give you the various reasons why you need to.
If you run a blog from the past (an old blog), the truth remains that the articles you made back in time would have their dates attached to the snippets on search result. From a search engine user perspective, I can never click on an article that dates back to like 2 years ago when I can see another blog’s date on the listing displaying a date that’s barely 2 months back.
This is because every search engine user would be of an opinion that the recent dated blog post would have current information on their search query rather than the old one which probably would be outdated. One solution to avoid missing such additional traffic from search engines over flimsy excuses of your post’s date is removing the date from your search engine result snippets. Below is a complete guide to removing dates from your WordPress powered blog’s search result.
Removing Dates From Google Search Result In WordPress
Search engines get the dates attached to your articles on the search results from the dates been displayed on your article’s page. They are usually displayed using the_date() or the_time() function on the single.php file of a wordpress theme. The solution is either removing any of the available functions or to call the PHP function using a JavaScript since the search spiders do not crawl JavaScripts. Follow the below steps to achieve this.
1. Edit the single.php file of your wordpress theme.
2. Search for the_date() . If you can’t find it, search for the_time() or the_time(‘F jS, Y h:i A’) . It must be a function that relates to the_time() or the_date() . Though the functions might have different parameters in between depending on the theme, note that it must be around one of the functions above though yours might be a little different.
3. If the function found in your theme is the_time(‘F jS, Y h:i A’) , it definitely would be called in PHP as shown below.
<?php the_time('F jS, Y h:i A') ?>
All you need do is erase completely the code above and in a few weeks all your articles would be displayed without the dates after search engine spiders must have crawled your site.
This would also remove your the dates from the particular blog post pages on your blog so readers won’t be able to know when the article was posted excepting from the archive pages.
If you would love to display it for your readers only, then you would have to replace the code above with a JavaScript calling it using the document.write() function. Therefore replace the above code with the one below if you still want to keep it for your readers.
<script>
document.write("<?php the_time('F jS, Y h:i A') ?>")
</script>
We are assuming that <?php the_time(‘F jS, Y h:i A’) ?> is found in your theme’s single.php file, replace with the exact code on your theme and that’s it.
For Genesis Framework Child Themes
Genesis tends to have a different workaround for this. Edit your child theme’s functions.php file if you are making use of a genesis child theme, add thee below code and SAVE.
// OscarMini Date Removal for Genesis
add_filter( 'genesis_post_info', 'post_info_filter' );
function post_info_filter($post_info) {
if ( is_single() ) {
$post_info = ' by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
else {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}
}
That’s how easy it is to remove dates from your search engine results on your wordpress blog. You would not see the effect immediately on your search results because the search engine spiders would need to crawl your site and note the changes you’ve made before the effects are visible, and this might take a few days. For the blogger blogging platform users, I’ll make a tutorial for you soon. Cheers.
8 Comments
Thanks man! It’s works 😀
Nice write up… But i hope it does not have side effect?
It’s side effect is simply increasing your search engine CTR. Trust me. 🙂
Hi Oscar
I’m using solostream theme; and don’t seem to find any of the above listed codes in my single.php as well as funtions.php. Any hope for your boy?
Hi Unwana,
If you don’t mind, you might want to mail me a copy of the theme so I could check it out for you.
Thank you dear friend, Oscar Frank. I am searching this code for long days. I got here in your post. I think it will work now. coz date is removed from the single post in my blog http://www.imnepal.com. Let’s hope some days for google results. I have just pasted these codes in function PHP.
I’m glad it did work for you Mahato.
I am using wp Fanzone theme and in order to get rid of the date, you must edit content-single.php and remove the date div, then resubmit the page to google or refresh the sitemap