This article is all about Adding a Dynamic Year in Selected Post Titles. I will share why you should Add Current Year in WP Post title using shortcode. Along with that, I will also explain A Unique way to Auto Add Dynamic Year in WordPress Post Titles.
But before digging into the details, I would like to ask a very simple question about your behavior on the internet.
Have you ever observed your behavior to click on Google Search Results Page? Did you notice any pattern for choosing a particular link or post? Hmm?? Any Guesses..??? Think about it for a second.
Okay, let me explain why I asked you to think about your behavior.

Why you should Add Dynamic Year in WordPress Post Titles
According to a study, humans’ eyes don’t read all the letters one by one, especially on the internet. Human eyes scan text for Highlighted Words, Numbers and Bullet Points.
Out of these three; Numbers made the most impact on the human brain. Digits or figures easily slides into your mind and hit it hard. After that, our mind says ‘this message is important’. And this is how we choose to discover the same.
Now, let’s assume that you have searched ‘fastest WordPress themes’ on Google. And you get results as per the following image.

Experts say that there are high chances that you will click on the Second (2nd) Search Result instead of First (1st).
Though, both the search results’ title start with digits.
But, the 2nd result also highlighted the Current Year and everybody wants to read newer information first. That’s why most of us would likely to click on the 2nd Search result.
At this point, you may argue that I’ll also read the date on which the article gets published and then choose the link.
I would say, Yes, this could be one of the deciding factors in this case, but most of the times there will be only one or two results with the current year or any kind of digit in the result titles.
And the study further reveals that Article Titles with Digits or Years got more clicks in comparison to the Titles without Digits.
I am hoping that now you have agreed with my point.
How you should Add Dynamic Year in WordPress Post Titles
So, we have learned that Digits and Figures are important and we should use the same in our Article Title. But how… what is the correct way out???
One can simply Add Current Year i.e. 2017 in the article title while writing it. Like I have added Year in this blog post related to Best Free CDN Providers for WordPress in 2017, Go check that out.
But what about after one year?
Suppose, you will get a Search Result in Jan 2018 with the Post Title mentioned 2017. Will you click on that search result?
Well, for me, it depends. My first preference would be any other latest search result instead of last year’s result. And, if I am not wrong, most of us will do the same.
People tend to give less importance to the older information instead of new information.
So, next year, I have to update the post title manually to stay in the race. Right??
What if, your post title change automatically, and displays the current year instead of the old year. How about adding a Dynamic Year in Post Title…??? or Add Current Year in WP Post title using shortcode..?? That would be awesome… no…??
Hence, here I am sharing How to Auto Add Dynamic Year in WordPress Post Titles.
- First, you need to Activate shortcode for Post Title in WordPress,
- And then create a shortcode, which dynamically displays current year,
- Now, add Current Year in WP Post title using shortcode.
How to Activate shortcode in WordPress Post Title
You need to add the following code into functions.php file of WP theme:
//* Activate shortcode function in Post Title add_filter( 'the_title', 'do_shortcode' );
The above-given code adds a filter to the_title WordPress Function, which allows you to use shortcode in WordPress Post Title. Now, we’ll create a shortcode to display current year dynamically.
How to Auto Add Dynamic Year in WordPress Post Titles
Again, add the given below code in the functions.php file of your WordPress theme:
//* Shortcode to display the current year in WordPress //* shortcode: [year] add_shortcode( 'year' , 'current_year' ); function current_year() { $year = date("Y"); return "$year"; }
Alright, now add this shortcode [year] in your post title and it will auto add Dynamic Year in WordPress Post Titles.
At the backend, in WordPress post editor, your post title would look like…
Fastest WordPress Theme of [year]
And at the front end, your post title would look like…
Fastest WordPress Theme of 2017
Wrapping it Up
I do Auto Add Dynamic Year in WordPress Post Titles on various blogs using shortcode in WordPress Post Title. Do you use this trick on your WP blog? or you might find this information useful and plan to give it a shot.
I would recommend you to go ahead and give it a try. You can also modify this code for your customised shortcode you want to use in Post Title. Because possibilities here are endless.
Do let me know if you face any issue to Add Current Year in WP Post title using shortcode.
Happy blogging!!!
Further readings…
Right way to Optimize WordPress Robots.txt file for SEO
How to Optimize Images in WordPress
Most SEO friendly Permalink Structure for WordPress
How to Display Code Snippets in WordPress Post or Page
Disable WordPress Visual Editor on Individual Posts and Pages
Hi Saurabh,
I want to be able to add, in addition to a year, also current month. Also I want to be able to append the year only to the post from certain categories. How do I do that?
Thank you!
Hey Darius,
I have modified the code as per your need… use the following code to display Current month and year (Feb, 2018).
//* Shortcode to display the current month and year in WordPress
//* shortcode: [month_year]
add_shortcode( 'month_year' , 'current_month_year' );
function current_month_year() {
$year = date("Y");
$month = date("M");
return "$month, $year";
}
You can use the
is_category
to display in certain categories.Cheers!
I wonder that changing post tile manually affects Seo badly or not. For example I have XYZ 2017 and want to make it XYZ 2018. If I want to make it manually I will go to post in dashboard and just make 2017 => 2018, right? I want to ask you one more question. What about if I remove the year? What happens then?
Hi Alaba,
It totally depends upon what you are changing in the post title. Changing year in the post tile manually or automatically should not affect SEO.