Site icon Mister Dif Reviews

Add an Automatically Updated Copyright Date to your Website

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?


Here are some ways to set an automatically updating copyright date that is dynamic and always shows the current year with code snippets for Javascript, Php which will work in WordPress and a solution setting the copyright year automatically in your Shopify theme footer:

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 auto updating 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.

Add an automatically updating copyright date with Beaver Builder for WordPress

With the Beaver Themer plug-in, you can just add:

[fl_year]

inside [ ]

Add an automatically updating copyright date in Shopify

You’ll need to dig into your theme’s liquid code a bit but here’s what to add:

&copy; {{ 'now' | date: '%Y' }}

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.

Photo by Heather Zabriskie
heatherzabriskie.com

Exit mobile version