How to Automatically Update Your Footer Copyright Year

TLC for CoachesWeb Design, TipsLeave a Comment

Automatically Update Your Footer Copyright Year

Did you know you can automatically update the year in your website footer each year with a little bit of Javascript? Here’s how to do it!

In the footer of your WordPress theme, or HTML files where your copyright date is typically stored and requires yearly updates, replace the current year with the following code.

<script type="text/javascript">
  document.write(new Date().getFullYear());
</script>

This is the core code that will just give you the year and will update every year, like this:

If you’d like a little more information or like to include the year you started, you can do something like this:

&copy; 2018<script>new Date().getFullYear()>2012&&document.write("-"+new Date().getFullYear());</script>, My Coaching Business. All Rights Reserved.

This will display the following:

© 2018, My Coaching Business. All Rights Reserved.

Naturally, you can play with it and work it in how you’d like, but that is the gist of it.

Some WordPress themes and frameworks are including this functionality in the settings. If yours doesn’t, then this should work and your website will never look out of date again.

If you have a wordPress theme that doesn’t support this, you can also accomplish the same thing by adding this code to the footer.php file:

<?php echo date("Y"); ?>

Happy New Year!

Want more?

Get instant access to our free online library and toolbox full of helpful time-saving ebooks, printable checklists, royalty-free graphics, training videos, templates, shareable social media images, and much more! We’re pretty confident you’ll find something useful in there that will help you build your business online!

Free Digital Resource Library

Already a member? Awesome! Login >>

Penny for Your Thoughts?

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