In past days most newbie bloggers ask me one question that is “How do I automatically change the copyright year in WordPress?”
You can see some sites have outdated copyright days and some have also the same year only. Now in this post, I will tell you different ways to automation of your WordPress copyright year/static time stamp.
Most WordPress themes have a place in the footer for copyright information or site credits.Sometimes this is in the file
footer.php, the various way sometimes it’s not. It depends on the theme.
I’d like to show you not only how to change the copyright year automatically, but also how to change all types of dates.
Simple PHP Snippets for Automatic Copyright Date
Here's the same in PHP so you can do this server-side. Use WordPress? Find the 'footer.php' in your Editor and add this there (here are videos to help you with that). The below snippet will just show the current year:
This will just give you:
Or if you want more detail in your footer, use something like this:
This will just give you:
© 2008-2017 Company.
What BesuccessBlogger Use
And This will give you
Copyright © 2015 - 2017 · Company Name · All rights reserved
Change 'company.com' to your site address and "Company" to your Site name.
Automatically Copyright Year According to First Post and Newest Post
I saw a more elegant solution suggested by @frumph of CompicPress Theme. They are using this function on their excellent ComicPress theme. This function will generate a dynamic copyright date based on the published date of your First post and the newest post. If it is the first year of your site, then this function will automatically display only the current year.
To implement this dynamic copyright date in your WordPress footer, open your theme’s functions.php file and add the following code:
Then open your theme’s footer.php file and add the following code where you want to display the date:
<?php echo comicpress_copyright(); ?>
This function will add the following text:
© 2015 – 2017
How WordPress Uses Dates and Times
WordPress core, themes, and plugins use PHP as a server-side programming language. What’s important to know is that WordPress uses PHP conventions for dates and times, and it uses the time from the server it is running on.
PHP has a function called .
date() What the
datefunction return is the current date or time, as represented by certain letter symbols. Here is a chart of the more commonly used PHP date and time symbols.
|Y||Numeric 4-digit year||Ex: 2012, 2015|
|y||Numeric 2-digit year||Ex: 01, 16|
|F||Full text of the current month||January—December|
|m||Number of current month, with leading zeros||01—12|
|n||Number of current month, no leading zeros||1—12|
|M||Three letters of current month||Jan—Dec|
|l||Current day, full name (lowercase “L”)||Sunday—Saturday|
|D||Current day, three letters||Mon—Sun|
|d||Day of the month, with leading zeroes||01—31|
|j||Day of the month, no leading zeroes||1—31|
|S||English suffix for day of the week||st, nd, rd, th (1st, 2nd, 3rd, 4th, etc.)|
|z||Numeric day of the year (starts with 0)||0 through 365|
|H||Hour, 24 hour, with leading zeroes||00 — 23|
|G||Hour, 24 hour, no leading zeroes||0 — 23|
|h||Hour, 12 hour, with leading zeroes||01 — 12|
|g||Hour, 12 hour, no leading zeroes||1 — 12|
|i||Minutes, with leading zeroes||00 — 59|
|s||Seconds, with leading zeroes||00 — 59|
|a||Time of day, lowercase||am, pm|
|A||Time of day, uppercase||AM, PM|
|T||Timezone abbreviation||EST, PST, MDT, etc.|
|e||Timezone identifier||UTC, GMT, etc.|
Ever looked at a website and wondered if it is still in operation? Maybe a thing or two looked like they could have been updated – and then you notice the copyright notice the in the footer. "2012. Right, this site must be dead. Let's move along."
Of course, it could be that the owner just forgot to update the year in the footer. That happens a lot, especially if those years are hard-coded strings. To future-proof your footer, it's better to just let computers take care of this. Grab one of these snippets and paste that on your page (or forward this site as a friendly reminder to someone who can do it for you).
Don’t keep your copyright dates outdated. Use these methods to update your copyright year updated and be lazy for futures.