I am still seeing Blogs and Onlineshops with an outdated year in the footer. This looks unprofessional and hurts trusting the website. If someone can't manage their footer, is it safe to provide my data?
Here is a little JavaScript snippet that you can add in your footer and never have to think of updating it again after the New Year.
Note: There are a few blogs that recommend calling document.write()
, this is considered poor practice. Using document.write()
would lead to halting the DOM creation and slow down the webpage. Instead you can use a selector and insert the year via innerHTML.
In WordPress the code should be inserted in the footer.php
of your child theme right before the closing </body>
Tag.
Snippet for your footer
Happy Coding! ✌️