by Erik Ford with 1 comment.
Towards the end of 2009, there were several friendly reminders from the Twitter-verse to update the copyright year on sites you’ve developed to reflect the current year. Depending on how many pages a given website contains, this can be a proverbial pain in the you know what. Plus, one of the last thing that will be on your mind during the holiday week will be whether your copyright notice is up to date. Why not drop in a couple lines of javascript code that will automatically update for you each and every year?
Add the following lines of code to your document before the closing <body> tag and presumably in your footer area:
<script language="JavaScript" type="text/javascript"> today=new Date(); y0=today.getFullYear(); </script> <p>Copyright © 2007 - <script language="JavaScript" type="text/ javascript">document.write(y0);</script> Your site name. All Rights Reserved.</p>
This is all you need to automatically update the copyright year on your website using a smidgen of javascript. From here on, though appreciated, you wonʼt need to be reminded to update that pesky date on January 1st.
How do I update my copyright notice in WordPress?
While this code will work fine in your WordPress theme, I would recommend leveraging the power of PHP to get the job done. You wonʼt have an inline javascript call and it is less code (remember to keep that mark up clean and lean).
Place the following code in the footer.php file of your theme:
<p>Copyright © 2007 - <?php echo date('Y'); ?> Your site name. All Rights Reserved.</p>
And, once again, you have a simple and worry free method of updating that copyright notice. I hope you found this helpful and Happy New Year to you all.






Cool script, thanks !