How to AUTOMATICALLY Update Your Copyright Year

Post by:
Andrej Hribernik

It's Happy New Year, and the first thing you will need to do is updating your website and making sure everything is updated. It may be the title date in your blog post, the date in your socket, or a changed, updated information in your content. 


In this blog post, I will help you solve two of those things. 


What if there was a way to update the year in your content and copyright notice on autopilot? Well, with a line of code, you can do precisely that. It is a problem that my clients and I never want to worry about again, and neither should you. 


First things first, here is a list of things your footer should include:

  • Copyright Notice
  • Your contact details
  • Links to pages that are not in the main navigation
  • Location map (if you are a physical business)
  • Links to your policies
  • Social media links
  • A newsletter sign-up box


As for updating the copyright year, add this little piece of code, and you will never have to worry about updating your year again, as this will do it automatically for you!

The Code

Enter the following HTML code for the various scenarios:

Simple:


<p>Copyright &copy; <script>document.write(new Date().getFullYear())</script> Your Name All Rights Reserved</p>


Date range:


<p> Copyright &copy; 2014-<script>document.write(new Date().getFullYear())</script> Your Name All Rights Reserved</p>


Center copyright notice:


<p style="text-align: center"> Copyright &copy; 2014-<script>document.write(new Date().getFullYear())</script> Your Name All Rights Reserved</p> ‍

Add the line of code that corresponds with your desired outcome and change the content information you want to include.

How to AUTOMATICALLY Update Your Copyright Year
This is how it should look like on your website
How to AUTOMATICALLY Update Your Copyright Year
This is how you should modify the code

Top 5 examples of socket descriptions:

1. Apple

This is how the socket area currently looks like on the Apple's website

Socket Description Example
The socket example on Apple's Website

2. McDonalds

This is how the socket area currently looks like on the Apple's website

Socket Description Example
The socket example on McDonalds website

3. Starbucks

This is how the socket area currently looks like on the Apple's website

Socket Description Example
The socket example on Starbucks website

4. Youtube

This is how the socket area currently looks like on the Apple's website

Socket Description Example
The socket example on Youtube's website

5. Google

This is how the socket area currently looks like on the Apple's website

Socket Description Example
The socket example on Google's website

I hope this article is helping you solve that problem, and if you have any other web development questions, let us know in the comment section below.