How To Automatically Display The Right Year in Your WordPress Site's Footer
Almost all sites include a copyright notice and year in the bottom footer area of each website page. Typically, the year is configured to auto-update, but not always. In cases where the year is manually updated, weeks or months can pass before someone realizes that the copyright has not been updated for the current year.
With a little planning, your site can always be up-to-date instead of relying on someone to manually update the copright notice each and every year.
Approach 1: Check your WordPress theme's documentation.
Displaying the current year in the footer is a common element on most sites and many WordPress theme developers make it easy for you to ensure the right year is displayed automatically. Astra is a WordPress theme that offers instructions on how to create custom footer text.
Approach 2: Manually update your WordPress theme's files.
While logged into your WordPress site's dashboard:
- From left hand navigation, select Appearance > Theme Editor
- On the right-side select “Theme Footer” to open the file named "footer.php" which is where this information is typically stored
- Add the following PHP code to display the current date
©<? echo date(Y);?>
WARNING: This approach is risky if you are not already using a "child theme." If you are not using a "child theme" and ever update your theme, your changes will be lost.
TIP: If you are adding the copyright notice in your site's footer, also add in any "Paid for" or similar language that you are required by election laws to include on your site. Placing in the footer will make it harder for someone to inadvertently alter the language or accidentally delete it.