Auto-Updating the Year in your Website Footer

by Steve Heideman on July 20, 2011

modify footer copyright year automaticallyThis is a little tip for all my website manager friends out there. One of my least favorite tasks is going to all the sites we manage every year and updating the copyright notice in the footer. The other day, I was browsing an article when I came across a “DUH” idea. I am actually a little bit embarrassed that I didn’t think about it before but, what are ya gunna do? The idea that I stumbled upon was using PHP to automatically update the year. The code is super simple and darn near faster than writing “Copyright 2011” or whatever year it happens to be.

Just drop this little snippet of code in your footer and you will never have to worry about it again:

&copy; <?php echo date(Y);?>

That’s it.

Hope this helps at least one person out there. Got any other “DUH” ideas? Please share them with us in the comments.

Leave a Comment

Previous post:

Next post: