Skip to content

How to Auto Update the Copyright Year in a WordPress Footer

An out-of-date copyright year in a site’s footer is a common sight, especially early in a new year. It happens because people don’t take advantage of WordPress’s server-side language, PHP, to auto-update the copyright year in WordPress. Instead they’re manually changing it. But it’s a complex and menial task, so it’s easy to put off.

Copyright statements are tiny and easy to overlook, but having a current one is a mark of a well-maintained site. If it’s been on your to-do list to change over your site’s year manually (like it’s been on mine!), this tutorial will teach you how changing a few lines of code will mean that you’ll never have to worry about it again!

Figuring out how to auto update the copyright year in HTML is easy if you use the power of programming language like PHP. Here’s how to prevent this problem and automatically update copyright year on your WordPress site. First, on video:

And if you prefer, in writing…

  1. Open up your text editor and FTP software. In this example, I’ll be using a program called Coda which functions as both. You should already have your FTP software configured so you have access to the server-side files for the site you’re working on. This is the first step to update the copyright year in WordPress.
  2. Open up footer.php in your Parent theme’s folder on your server. In this case, the location of the file is: public_html/wp_content/themes/rosemary/footer.php.
    how to change footer date wordpress
    (click to enlarge)
  3. Copy all the code in your Parent theme’s footer.php file.
    how to change footer date wordpress
    (click to enlarge)
  4. Create a new file within your child theme and title it footer.php.
    how to change date footer wordpress
    (click to enlarge)
  5. Paste the code you copied from your parent theme’s footer into the new footer.php file you created within your child theme.
  6. Now’s the time to auto-update copyright year! Find the portion of the code in your footer that controls the date. Typically it will be something as simple as finding the previous year’s text (ie. 2015) and replacing it with echo date( 'Y' ). It sometimes recommended that you state this as a range, like 1999-{current year}. You can generally add any other text necessary for your copyright here. Because our theme was set up to be able to edit the date from the appearance customizer, it looks slightly different.
    how to change footer date wordpress
    (click to enlarge)
  7. That’s it! Save the changes to your server and check your site to make sure all the changes you made worked as expected. Keep in mind that you might need to delete your cache if your changes aren’t appearing immediately.
    how to change date footer wordpress
    (click to enlarge)

     

    Never look like a doof with an out-of-date footer year again. Thanks to the functionality of the auto-update copyright year in PHP, your website will be looking good (or at least better) from top to bottom.

Yay! 🎉 You made it to the end of the article!
David Hayes
Share:

5 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
CCCCCC
August 5, 2023 1:55 am

Thank you. it’s worked!

mohamed
January 28, 2021 5:49 pm

Is there a way to update the custom filed “date” filed and countdown in a product page automatically weekly?

Because we are managing website for offline courses, we need to update all dates periodically but it is very hard to do it manually.

mtcreations
March 29, 2016 10:08 pm

I prefer a hybrid solution, which is to have a start date/year of copyright that is a constant, and then this solution as the rolling forward portion.
EX: copyright 2011-2016, all rights reserved.
This covers the span of time work is created, from the beginning to current date.

William Nettmann
April 1, 2016 6:00 am
Reply to  mtcreations

That makes sense. It also imparts a sense of the longevity of the site – © 2016 may be a new kid on the block.

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!

5
0
Would love your thoughts, please comment.x