Automatically update copyright text each year

Update copyright data automatically in wordpressHaving a copyright notice somewhere on your pages is always a good idea.

However to keep the copyright notice valid and ensure that your site looks professional, it needs to be updated each new year.

With the little trick in this post, you can insert a small piece of PHP that automatically updates your copyright text in your website or WordPress powered blog.

Automatically update copyright text

The basis of this little trick is the PHP date function.

If you use the PHP syntax: date(‘Y’), PHP will output the current year (based on the date in the hosting environment).  With this knowledge, you can easily build a small piece of code that automatically updates your copyright text:

Copyright &copy; 2007-<?php echo date('Y'); ?>

With this little trick you can spend 5 min to ensure, that your PHP site or WordPress based blog is always having a updated copyright text.

Share and Enjoy

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS
fold-left fold-right
About the author
Jørgen Nicolaisen has been passionately interested in everything online since 1995. His experience is based on working with small hobby projects as well as high volume websites. Jørgen is currently focused on the PHP based programming framework - Codeigniter, and WordPress naturally

Comments are closed.