The Problem: Every year the footer of your personal or company website will need to be updated. It would be a waste of your time and you would risk breaking your code if you needed to update every single webpage to type “2020” in the footer of the page. This should be automated.
The code above can be copied and pasted into the footer of your website pages. If you have a couple of static pages, it isn’t a big deal to edit each page. In my case, I added the code to the footer.php file for my custom WordPress theme. WordPress automatically appends the footer.php to every new post or page that I create. Now a user will always see a dynamically generated date at the bottom of the page.