Auto-update copyright year
Ajith | Jan 2010 | Blogging Tips
It is that time of the year where you do a lot of update activities on your blog including stock taking of the past year, wishing friends & family, setting goals, taking new year resolutions etc. It is also a good time to update certain important areas of your blog – Yes I am talking about updating the copyright year on the footer of your blog.
When I checked most of my friends’ blogs today I found that the copyright year is still 2009. Mostly, every year you hardcode this value but there is an easy way to auto update the copyright year using a simple one-liner script. Once it’s in place, you don’t have to worry about updating the year again. The following is the copyright script that you need to add to the footer of your WordPress blog (or any blogging platform running PHP):
Auto update copyright year script
The following is the simplest form of the script that you can include in an appropriate part of your footer:
Copyright © <?php echo date(’Y'); ?> YourBlog.com
(Just replace YourBlog.com with your blog name or domain name)
This will render your copyright information as:
Copyright © 2010 YourBlog.com
You can play around with other options such as:
© <?php echo date('Y'); ?> YourBlog.com
..to get a result like this
© 2010 YourBlog.com
or even give an year range using…
Copyright © 2005-<?php echo date('Y'); ?> YourBlog.com
..where the output will be as given below:
Copyright © 2005-2010 YourBlog.com
(Year range copyright assuming that 2005 was your starting year from when the copyright is applicable)
Note: This script takes the date and year information of the server. Hence, if your hosting server is in the US, and if you are browsing from India or so on New Year morning, do not panic if you see still 2009. By midnight or on the following morning you will see the copyright year reflected. You can also use a Javascript code to update the year which will overcome this minor issue but I prefer to stick with PHP.
Have you already updated the copyright year on your blog?


That is really handy, because I always forget to update the year on my blogs.
Tom, glad to know that you found it useful.
After reading first few line I rush for the update and after reading the whole tutorial I put the code. Thanks for sharing this.
Arafat, done! So no need to worry next year
Good point. I’ve been doing exactly the same on my blog from the day 1. The original free theme I had on my blog earlier had this code to get it done. I took that and started using it on the thesis theme also.
Thesis didn’t have this in place? strange, they have all possible customizing options i thought
Just made me remember I have to update mine too.
Hope you have already done it now
luckily my theme already does that for me..
Yep, a lot of themes have that code in place, I guess.
and by the way (offtopic), you already received my head to head questions?
You must have already got it by now, Melvin. Sorry for the delay
Will try this.
Give it a try… just saves you a few mins next year
Yes, its working, thanks alot for the tip.
Great…
I did this change 2 days ago and also thought of posting a blog post.
Here it is…. May be i should do it so that my blog readers can also get to know.
Nihar, go ahead and inform your readers as well.
Hi Ajith, I just want to share something here mate
About your article on auto-update copyrighter years, I do not even updated it … but I deleted it from my footer LOL but thanks for sharing your tips, maybe I’ll use your tips next time on my other blog.
Marikxon, copyright notices are not always necessary
Nice tip Ajith, thanks very much, just implemented.
Cool php code. loves it. I guess that means my hardcoding days are over.
[...] it and are looking for tips on how to do then you can read this post on dot com mogul John Chow or this post by [...]
Good tip from a great programmer (I read your interview in melvinblog recently and I see you describing yourself as 90% programmer…automating blog is again very interesting..)