How to autoupdate copyright year

Sometimes when I go blog hopping I’ll notice some sites have a copyright signature. This is a great idea to protect your data, however, when I see them with the wrong year, I think it looks so outdated. (Especially when it’s static, and also on the front page- Yikes!)

To avoid this, it’s better to use a script that will display the year based on the first post and last post year. This way, you will have to never worried about updating the year.

First, please open our beloved functions.php under themes folder, and put this code below in the bottom:
blogfreakz pic1 How to autoupdate copyright year

You can modify this section if you want to put in another word before the text:
$copyright = “& my footer copyright - “

To use this function, you can put this function anywhere you want to use this tag:

In my wordpress blog, I want to put this in my footer, so I edit my footer php as follows:
blogfreakz pic 2 How to autoupdate copyright yearThis results in:

blogfreakz pic 3 How to autoupdate copyright year

Incoming search terms for the article:

6 Comments

  1. Bob@Madbid

    10.02.2011

    Absolutely loving these posts at the moment. Simple tips like this are the big differences between owning an amateur and proffesional blog. Keep up the great work BlogFreakz!
    Bob@Madbid´s last blog ..Madbid 2nd October 2011 WinnersMy ComLuv Profile

    • Nancy

      10.27.2011

      Thanks Bob!

      Sometimes simple works best!

  2. Marius

    10.13.2011

    Hi Nancy,

    I’m not sure I understand but you want to display a copyright notice based on the year? Say: your first post is from 1 may 2007, then it will display (c) 2007 on this post particularly ? If not, it’s not simpler to just use:
    echo date(‘Y’)
    to always display the current year?
    Thank you and sorry for my bad english.

    • Nancy

      10.27.2011

      Yep that totally works too!

  3. Myrtie

    10.13.2011

    Does this pull the year from the server time, or from the users system clock? (ie. will it display whatever year the users clock says).

    Either way - very useful information! Will save me a tonne of time having to update all my sites!
    Myrtie´s last blog ..Maryland Car InsuranceMy ComLuv Profile

  4. Nora @Logo Design

    10.27.2011

    Very nice tuts. that will help me to keep update! ]thanks for all this nice share:)
    Nora @Logo Design´s last blog ..30 Speech Bubble Logos – The Thinking SymbolMy ComLuv Profile