Code For Automatic Copyright Year Change In Wordpress Theme Footer

This time of year one task that some of us might have to do is to change the year on our Copyright notice in the footer of our Wordpress Theme. Some themes will already have this code installed, especially premium themes that you will have had to pay for.

But in many cases, when using a free theme or older Wordpress theme you may find that the code to do this is not included andĀ  that you have to manually change the year yourself.

Don’t Do It Manually – Make It Automatic!

copyright2010

eg: HOW TO CHANGE 2009 TO 2010 AUTOMATICALLY

It’s easy to do but if you have several blogs or Wordpress sites it’s a lot better if your code does the Copyright year change for you automatically.

Changing the year manually just requires using the Wordpress Theme editor in the admin dashboard to change the code by replacing the previous year value with the current year value.


So if you have to use the Theme editor anyway why not add some additional code so that you will never have to the Copyright year change again manually, as the code you add will do the change to the copyright year manually forever after you add this extra code.

Even if you have not use the Theme Editor before it’s no big deal as it just lik editing a post – if you use Wordpress you can do it!

How To Change Copyright Year Code In The Wordpress Footer.php File

First when in the Wordpress admin dashboard area you need to click on APPEARANCE and then the EDITOR option. Over to the right hand of the Editor window there will be a list of all the Theme Files and you need to click on the Footer file (footer.php) as this file is what you need to edit for the copyright notice and the automatic year change code.

You will then see the footer.php file displayed in the theme editor window so you can now edit the code in the file. You will need to scroll down to find the relevant code for the year and coyright notice.

Alternatively if you get stuck just use the Find facility (Edit option) in your web browser to find the year currently being displayed in your footer.

When you have found it you should replace the value shown for the year (eg: 2009) with the following piece of code:

wpyearcodephp

So just click on the Update File button below the editor and you’re done.

And now the Copyright year displayed will ALWAYS be the CURRENT year – forever!

If you don’t have a Copyright notice with a Year displayed at all then you can add the following code to do so:

wpcopyrightyearcodephp

This includes the copyright notice and year in a paragraph of it’s own.

Alternatively you can also display a year range, where the initial year is fixed and set (edited) by you:

wpcopyright2yearsphp

You can also using JavaScript instead of PHP code to do the automatic copyright year change for you, but if you use this and JavaScript is not activated in your site visitors browser then it won’t work. The code is only included here for completeness and also beacuse your theme may already have it coded in and you might want to change to the simple PHP version above:

wpcopyrightyearcodejavascript

Finally to make your job even easier I have created a .txt file with these code examples in it which you can download and thenĀ  copy and paste the code you need for you Wordpress footer.

Download Copyright Year Change Code Examples here

(right click to save to your desktop)

Good luck with the change and if you need help just leave a comment.

Happy New Year!

ps: the code above can also be used in non-Wordpress sites too (eg: html or php website)

More Wordpress Tutorials

Leave a Reply

WORDPRESS HOSTING DEAL

Wordpress Training

Wordpress Crash Course

Wordpress Crash Course

Wordpress for BEGINNERS!

Digging Into Wordpress !



DOWNLOAD NOW - Features 400+ pages of practical WordPress wisdom!

ADVANCED Wordpress

Subscribe To Our Tutorials

 Subscribe in a Feed Reader

Subscribe by Email:

Backup Buddy WP Plugin

Backup Buddy

Backup or Clone a WordPress site!

Including widgets, themes and plugins

Best Wordpress Books!

-
VISIT OUR
WORDPRESS BOOKS STORE
Checkout the Best Sellers !

Spread the Word!


Social Bookmark This Site