Free Consultation

Dynamically Add a Copyright Year to a Website

Closeup of HTML Code

Most websites need copyright information in the footer. Usually the current year is included in the copyright info. You can code in the year by hand, but if you want the website to stay current, you will have to go back change the year every January for the rest of the website's life.

An easier way to have a current year in the footer is to use PHP to grab the current year and display it. This way the year will always update itself and keep your website up to date.

How to add the year

Adding a year using PHP is very simple. Just add the following line of code where you would like to insert the year: <?php echo date(Y); ?> Make sure that your website file is saved as a .php file and not an .html one. Save the file and refresh your browser and relax knowing that you won’t have to keep updating the year on the website!

Lead Generating Websites Starting At $150/month

Questions? Let's talk and see if I'm a good fit for your business.

(Expect a fast reply 😁)