The following post is part of my Thesis tutorial series. In this post, we’re going to be looking at how to customize your date display.
In the past 12 months, Google has gotten much more aggressive about displaying dates in SERP listings. Since many of the sites I publish have evergreen content, they suffer from lower SERP CTR when “old” dates are shown in the SERPs.
However, as has been pointed out, I am doing my readers a disservice by not showing the date on the post. So I’ve come up with a workaround that lets me display the date for users–but in a format that Google currently can’t extract.
This tutorial is written for Thesis (see my Thesis wordpress theme review) but can be adapted if you are using another theme. First, make sure you turn off the author’s name and date. To do this, go to thesis > design options > display options > bylines and uncheck the box.
Now your post should have no date or author. Next, open up the custom functions file and create a new function. I’m calling mine “uauthor_byline”.
//this is author byline
function uauthor_byline() {
}
You’ll need some logic to display the dates only on single post pages. Here it is.
if (is_single()){ }
Inside of that function, you will need some date logic that figures out how old a post is and decides between two display variations. Set a variable for the post age, as shown below.
$daysold = (current_time(timestamp) - get_the_time('U') - (get_settings('gmt_offset')))/(24*60*60);
if ($daysold < 180) { } else { }
Here’s the logic to change the display based on post age. I’m going with 6 months, which is 180 days. If a post is less than 180 days, I’ll show the full date; if it’s older than 180, I’ll only show the month and year.
if ($daysold < 180){ <? the_date('F j, Y'); ?> } else {<? the_date('F Y'); ?>}
The only other thing you will need is a link with the author’s name.
<span class="headline_meta">Written by <span class="author vcard fn"><? the_author_posts_link(); ?> on </span></span><
Bring everything together like this:
//this is author byline
function uauthor_byline() {
$daysold = (current_time(timestamp) - get_the_time('U') - (get_settings('gmt_offset')))/(24*60*60);
if (is_single()){ ?>
<span class="headline_meta">Written by <span class="author vcard fn"><? the_author_posts_link(); ?> on </span>
if ($daysold < 180){ <? the_date('F j, Y'); ?> } else {<? the_date('F Y'); ?>}
?> </span> <?
}
}
The last thing to do is call the function in the right place. In this case, you will use the before post hook, like this:
add_action('thesis_hook_before_post','uauthor_byline' );
And here are the two variations–one just before the 180 days and one just after.
It should be noted that this is a workaround and, at some point, Google may get smart enough to interpret this or adjust its date algo. At some level, we are engaging in a bit of trickery for our own benefit. If you want to avoid this “little white lie,” you should update your evergreen content regularly and use a seasonal living URL strategy. This ensures you give the users the most up to date info without tricking anyone.
If you want to use this tutorial, it works best with the Thesis Theme. If you purchase from that link, I do receive a commission; however, I use Thesis on this website and many others and am very comfortable recommending it. If you want to spend less time playing with theme and more time creating content, Thesis is an excellent platform to do it on.
Related posts:
- Thesis Tutorial – Adding Date Based Triggers to Your Posts There are a lot of times when you are working…
- Thesis Tutorial: How to Conditionally Change Content In yesterday’s post, we spoke about why you would want…
- Thesis Tutorial – How to Add Adsense Section Targeting Using Adsense on your blog usually isn’t the most profitable…
- How Google is Reverse Engineering Page Dates In recent weeks I’ve noticed a disturbing new trend in…
- Wondering Why I see So Many Dates in The SERPS Here’s a screen shot of a Google search I did…
Advertisers:
- Text Link Ads – New customers can get $100 in free text links.
- BOTW.org – Get a premier listing in the internet’s oldest directory.
- Ezilon.com Regional Directory – Check to see if your website is listed!
- Directory Journal – Get permanent deep links in a search engine friendly directory
- Glass Whiteboards – For a professional durable white board with no ghosting, streaking or marker stains, see my Glass Whiteboard Review
- Need an SEO Audit for your website, look at my SEO Consulting Services
- Link Building- Backlink Build offers 45 PR5+ Backlinks for $295
- KnowEm – Protect your brand, product or company name with a continually growing list of social media sites.
- Links From PR9 Sites – - Get In Top 3 Google ASAP
- Scribe SEO Review find out how to better optimize your wordpress posts.
- TigerTech – Great Web Hosting service at a great price.
- What Motivates You – what makes you want to get up and be successful
This post originally came from Michael Gray who is an SEO Consultant. Be sure not to miss the Thesis WordPress Theme review.










Webinars can be a strong lead generation tool for businesses. This month, for instance, we at HubSpot were able to attract 10K leads from our big webinars. So are you leveraging this channel for what it’s worth?
This week, video distribution company
Whether or not you’re into the most talked about wedding of the century (ahem, 



Mari Smith





