How to Add a Dynamic Copyright to Your Web Site Footer

In preparation for the new year, this is a simple but useful PHP snippet for keeping your copyright notice up to date on your blog or Web site.

<?php
echo 'Copyright &copy; 2006 &ndash; ' . date("Y");
?>

That will output Copyright © 2006 – 2007, with the “2007″ dynamically updating to the current year.

The HTML entity &ndash; just means a dash. You could also do just:

Copyright &copy; <?php echo date("Y"); ?>

…which would output Copyright © 2007 (with the date always being the current year).

It works on WordPress blogs also — just insert the code snippet in footer.php.

3 thoughts on “How to Add a Dynamic Copyright to Your Web Site Footer

  1. I recommend that a date-last-modified bit be added for those of us pour souls who do web research a lot. Just remember to put this code on the actual content page, not include files that exist on every page, etc.

  2. Comment field swallowed my code… here ya go with slight mods:

    <?php
     
    $last_modified = filemtime("thisfile.php");
     
    print "Last modified " . date("l, dS F, Y @ h:ia", $last_modified);
     
    ?>
  3. Resources for all the colleges – higher education and employment in Canada and in the world. Info about undergraduate, career resources, jobs by location, information for students.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>