Especially in January, you start thinking about copyrights on your websites. This is one of those maintenance tasks ripe for a programmatic solution. There is no reason to manually update the years on your website’s copyright year after year. Here are a few good options for creating an automatically updating copyright year on your website.
JS script and HTML Div
<script>
myDiv = document.GetElementById("myDivId");
myDiv.innerHTML = month[day.getMonth()]; // you can add any HTML markup here
</script>
<div id="myDivId"></id>
Original inspiration from this post: fix without javascript error.
Change copyright year automatically with inline Javascript
<html>
<p>Copyright © <script>now=new Date(); year=now.getFullYear(); document.write(year);</script> Company Name.</p>
</html>
If you’re using a visual builder in WordPress, remember you can often choose the Text tab instead of the Visual tab so that you can include a script in your text box.

PHP copyright year for WordPress PHP file
<p>© <?php echo date('Y'); ?> Company Name</p>
HubSpot Copyright Variable for Year
© {{year}} Company Name. All rights reserved.
Add Copyright to SquareSpace – Inline Javascript
You can use the code block in SquareSpace to add a copyright year. Here’s a video that shows you how to do it. For more details, check out our post about SquareSpace.
Add Copyright to Wix Studio Global Footer – Use Velo Code
Place this code in the MasterPage.js file. This code inserts the bolded code below (© year Company Name. All Rights Reserved.) into the text element with the id that matches #copyrightYear. Velo code runs during sitepublishing, so your site will always show the copyright symbol, current year and any company/rights text that you choose with this method.
$w.onReady(function () {
const today = new Date();
const year = today.getFullYear();
$w('#copyrightYear').text = `© ${year} Company Name. All Rights Reserved.`;
});
This script looks for your text layer with the ID #copyrightYear. This is case-sensitive.

Optionally, you can console log if your ID is working by adding these two console.log lines.
$w.onReady(function () {
const year = new Date().getFullYear();
const copyrightElement = $w('#copyrightYear');
if (copyrightElement.rendered) {
console.log("Copyright element found. Updating year...");
copyrightElement.text = `© ${year} Company Name | All Rights Reserved.`;
} else {
console.log("Could not find element with ID #copyrightYear on this page.");
}
});

