Happy new year on your website every year with a code block

Venezia website template on iPad with copyright date
 
 

Oops! It seems to happen at the beginning of every new year! I forget to update my website copyright date!

Luckily, we can all avoid this and have one less thing to remember to do at the beginning of the new year. That’s one successful new year goal met already at midnight of the new year!

To accomplish this goal of an up to date copyright date (it's typically in the footer of your site), there is a code you can add to your site that will do it for you automatically each year. On your Squarespace website, simply add a Code Block with the following code:

 


<p style="text-align:right"> Copyright &copy;

<script>document.write(new Date().getFullYear())

</script> YOUR NAME HERE </p>

 

Replace YOUR NAME HERE with your business name 😉

The &copy will create a © copyright symbol for you.

You can change the “text-align:right” to “text-align:center” or remove <p style=”text-align:right”> at the beginning and also </p> at the end for the default to align your text to the left. The code would then look like this:

 


Copyright &copy;

<script>document.write(new Date().getFullYear())

</script> YOUR NAME HERE

 

Here are the step-by-step instructions on how to add a code block in Classic 7.1:

In edit mode,

  1. In the footer or wherever you’d like to add the new copyright date, click on the + and choose Code to add a code block.

  2. A code block will popup with <p>Hello, World!</p>

    Select this text and delete it.

  3. Add the code:

    Copyright &copy;

    <script>document.write(new Date().getFullYear())

    </script> YOUR NAME HERE

    (See the code box near the top of this post above for styling text alignment options.)

  4. Click Save and Exit.

    When in edit mode, your code will have the Script Disabled for Preview in Safe Mode like the image just below on the left.

    It will look just right out of edit mode like the image just below on the right.

Squarespace code block with embedded script in edit preview safe mode
 
Squarespace footer with new year copyright date

Here is how to add a code block in action!

 


Follow the same steps as above for adding a code block in Fluid Engine 7.1.

The only difference is how to add a code block.

In the footer or section where you’re adding the code block, Click + ADD BLOCK in the top left corner and choose Code.

 
button for adding blocks in Squarespace Fluid Engine
 

There you have it. Your copyright date is up to date. Every. Year.

So take that vacation and don’t worry about this one thing you have to do when you get back!

Happy new year on your website every year!

Cheers to ©2024! 💙

 
 


Related Posts

 

 
 
Taryn

Stylish + strategic Squarespace website templates designed for your small business to stand out.

https://www.tarynmercedes.com
Previous
Previous

Add anchor links to “jump” where you want on a Squarespace page

Next
Next

My favorite web design resources for anyone with a website