Out-of-date copyright dates are all over the internet.  In a way it’s good. It lets you know that the site probably hasn’t been touched by the webmaster since the year shown in the footer. But for your own site you always want that copyright date to be current. Right? So skip the Rose bowl and update all our websites on January 1st. 😬 Not. So why not just set the copyright information once?

Divi WordPress Theme
Here’s two ways to set an automatically updating copyright date that is dynamic and always shows the current year:

JavaScript solution to show automatically updated copyright date:

This JavaScript solution courtesy of this JS God.  Just drop this into a text widget for your footer if you have one.

&copy; <script>document.write(new Date().getFullYear())</script>

The &copy; gives you the © symbol and the script supplies the automatically updating copyright date. You don’t have a footer widget on your WordPress site?  You could add one but it might just be easier to add some php to your footer file. Which brings us to…

PHP solutions to display a dynamic copyright date:

Open the the footer.php file of your WordPress child theme and add:

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

Or if you prefer not to edit your footer.php file but still want to use PHP over Javascript, you could add PHP into your WordPress widgets BUT not until you’ve edited your functions.php file to allow PHP in the widgets.

Benefits of an automatically updated copyright date

Now you can keep your site off the pile of those with out-of-date copyright dates. Once you start, this becomes addicting and you’ll never want to build another site with an automatically updating copyright. That way you can get on with more important things on New Year’s day.

auto-update-copyright-dates

Photo by Heather Zabriskie
heatherzabriskie.com