I hope your website is ready for the new year?

Here is one small but important tip many people forget when a new year starts: Update the year in your copyright notice. You can either set yourself an annual reminder in your calendar, or use this little piece of code that will do it for you automatically!

Disclaimer: There is some controversy about using the document.write method, in some cases, it can cause problems with the website. Personally, I have not run into this issue, and for Squarespace websites, this method still seems to work great and is the best and easiest solution I’ve found. However, if this causes problems on your website, then, of course, don’t use it; just set yourself a reminder in your calendar to do it manually.

The Code
Add a code or markdown block to your footer and 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>

I hope this helps you.

Originally posted on January 8, 2024 @ 2:25 pm

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.