Here’s a quick little tip to help keep your blogs copyright year automatically up to date. Many themes already include this functionality, but some do not. This code should work with any PHP based system but we are focusing on WordPress here…

  • In the WordPress admin dashboard, go to the Theme Editor (under Design > Theme Editor) and select the Footer template from the listed theme template files (usually called footer.php).
  • Look in the editor window (where the code is show) and scroll until you find your copyright text. Something like…
    <div id="footer">
    	All contents Copyright 2005
    </div>

    Cover your butt: Before you edit any template files you can copy and save the original text in the editor window to a text file on your local computer. This way you can simply copy it back to theme template file if you really mess something up.

  • To make the year dynamic we can simply use the PHP date command to grab the current year. So you would change the copyright text to…
    <div id="footer">
    	All contents Copyright <?php echo date("Y"); ?>
    </div>
  • You can also add in the copyright symbol (All contents Copyright © 2008) using the code…
    <div id="footer">
    	All contents Copyright &copy; <?php echo date("Y"); ?>
    </div>
  • If you want to have a starting copyright date (All contents Copyright 2005 – 2008) you would use…
    <div id="footer">
    	All contents Copyright 2005 - <?php echo date("Y"); ?>
    </div>

    This will leave the starting year always set to 2005 and the ending year will always be the current year.

  • When you have your updated code in there, hit the “Update File” button and go check out your handy work on your home page.