Automatically Updating the Copyright Year
In this guide, we'll add some code to your site so that you never have to worry about the copyright year being out-of-date.
As we approach the New Year, there's a task that many forget... updating the year in the copyright notice on websites. The number of sites I see that are at least a year out-of-date is pretty astonishing!
It seems like a small thing, but to me, seeing last year's date in the footer hints at a site that is not well maintained, and immediately makes me worry about other issues the site may have.
So let's look at how to add a little bit of code so that you don't have to remember to update the year manually...
Please note that this code cannot be applied to Squarespace websites on the "Personal" plan, as it requires access to the Code Block and Code Injection.
Step 1 of 2. Add the HTML
- Log in to Squarespace, then go to Pages and select any page.
- Scroll to your footer, click Edit and add a Code Block.
- In the Code Block, paste in the following code. We'll go through it in a moment.
<p> © ABC Company Limited <span id="copyYear"></span> </p>
- Click Save on the Code Block, then save the changes to the page.
- Note: The year will not be showing at the moment. Step 2 will solve this.
- The code starts with a paragraph tag <p>. This can be omitted, but gives you the option of adding additional styling if you need to. Remember to close it out with </p>.
- The © is HTML code for the copyright symbol (©).
- Obviously, replace ABC Company Limited with your own company name.
- The remaining code, <span id="copyYear"></span> is where the magic happens!
- Go to Settings > Advanced > Code Injection
- In the section marked FOOTER, paste the code snippet and click Save. It will look like this:
This code dynamically calculates the current year, then adds it as text to the <span> we created in Step 1. The result will look like this...
© ABC Company Limited