Automate Copyright Updates on Web Pages

  • Home
  • /
  • Blog
  • /
  • Automate Copyright Updates on Web Pages

Nothing earth shattering today, but a nice little new year item for your website.

Many web pages carry copyright notice that reflects the creation date of some or all of the content – Copyright 2003-2009 for example.

This is great until the year changes and you need to go back and update all your web pages. You can and should make this function easier with the use of footer library files or SSIs, so you only need to update once place and have it cross all your pages. But, you can even take it a step further and have the date change automatically.

Most blog themes have this function using a simple PHP call – Copyright © 2003-< ?php echo date('Y'); ?> – this would produce Copyright 2003-2009, and change to 2010 automatically next year.

You can also accomplish this with a simple javascript command placed in a footer file or anywhere on a web page where you want your copyright notice to show up.


Copyright © xxxx
script language="JavaScript"
var d=new Date();
yr=d.getFullYear();
if (yr!=xxxx)
document.write("- "+yr);
/script

Add <> around script language=”JavaScript” and /script

Replace the xxxx in both places with the year you would like to publish as the start year and then the script will take care of the rest. So for me it’s 1999 and looks like this Copyright © 1999 – 2009. Again, this will change to 2010 next year at this time without any effort on my part.

I’m sure there are a dozen other ways to get this done, but now you know it’s possible!

[FREE] AI Prompts for Building a Marketing Strategy

Picture of AI Prompts for a Marketing Strategy

Join 25k+ strategic marketers and level up your marketing game when you subscribe to our weekly newsletter - join now to get your free prompts!


Tags

copyright notice


You may also like