Get 30 days of Campaign Donut Free
Campaign Donut, Content Marketing Planning App Logo SVG
Always Updated Website Copyright Year, No Javascript

Written by Dave Shrein

Add Copyright Year to WordPress Footer Without JavaScript

Back in my web designing days there was one finishing touch that all my clients wanted for their website—after the favicon: the copyright year added to the WordPress footer.

The problem: I couldn’t find a solution that didn’t involve some form of JavaScript.

Until I did.

It’s been so many years that I cannot remember when or where I found this solution but it has been the same solution I’ve used to dynamically update WordPress website footers with the current year.

It’s simple. It involves updating your functions.php page one time and can be applied via shortcode.

I am sure there are plenty of better ways to do this that involve more complex coding—I just don’t know how to apply them and if you’re like me, you don’t want to take the time to learn.

A dynamically updating copyright year means that it will automatically update to the next calendar year when January 1 arrives, preventing an outdated copyright year.

So without further delay, here is a very short tutorial showing you how to add a dynamic copyright year to WordPress footer.

*Prior to making any changes to your WordPress theme files or WordPress core files you should backup your files and database.

Update Your WordPress Functions.php File

It is strongly recommended that you use a child theme when applying the following code. Using a child theme ensures that when your theme developer pushes an update to the theme, the changes you make today will not be overwritten.

Step 1 — Access the Editor Window

Login to your WordPress website and navigate to “Appearance>Theme Editor” (or it may say only “Editor”).

From the list of theme files in the right column, click the “functions.php” file.

WordPress built it editor allows you to modify theme files directly. Make sure you know what you’re doing because one error can throw off your entire site design.

If you are using a child theme and this is the first time you are making a change to your “functions.php” file, you won’t see much—if any—code.

If you are not using a child theme and making changes to your theme’s “functions.php” file directly, you will see quite a bit of code already written.

Step 2 — Add The Date Code to Your Functions.php File.

Inside the editor, you will paste the following code.

function year_shortcode() {
	$year = date('Y');
	return $year;
}
add_shortcode('year', 'year_shortcode');
This simple line of code placed in your functions.php file will create a shortcode that you can call in other places on your website.

Once you’ve added this code, click the “Update File” button to apply the changes. You won’t see anything immediately on your site because we still need to apply the the shortcode to the footer. As long as the file updates successfully, you can move on to the next steps.

Now that your “functions.php” file is updated, you need to tell your theme where to output the dynamically generated year. Unfortunately, this step could vary based upon what theme you’re using. Most premium themes make it easy to update the content in your footer, or in some cases it is called the socket, but if there is not a clear location, you will want to contact the theme developer.

For this example, I am using the Enfold Theme by Kriesi available on Themeforest.

Often your footer settings will be located in a theme specific menu section. The Enfold Theme offers this section labeled “Enfold” or “Enfold Child” — obviously, if you’re using a child theme.

Access the theme settings and navigate to the footer settings menu.

Once you locate your footer settings, place the shortcode [year] to output the current year on the front end of your website.

Where your theme footer settings are located will depend on what theme you’re using. In the Enfold Theme, there is a dedicated “Footer” menu inside the theme settings.

Some themes will automatically generate the copyright symbol and some will require you to add it.

If you need to add your own copyright symbol you can copy and paste the symbol from here © . If you’d like to type it yourself, and who can blame you—it’s fun to do, the copyright symbol keyboard shortcuts are as follows:

Mac: Option + G
Windows: Alt + 0169

Once you’ve added your shortcode and copyright symbol, save your settings.

Step 4 — Visit Your Website to Confirm Your Changes

After making any changes to your website—even publishing updates on old pages—it is very important to review your changes to confirm everything is as it should be.

To review your changes to the footer, navigate to your homepage and scroll down to the bottom of the page. You should now see the correct year outputted to your footer.

Always verify your changes—even if it is simply updating a spelling or grammar error. Here we are confirming the correct year output in our footer.

Questions?

If you have any question about configuring your WordPress site to output the current calendar year in your footer dynamically, send us a message or leave a comment below. In some cases we may be able to provide a quick solution, in other cases we may redirect you to either WordPress forums or your theme’s support desk.

At the end of the day we want you to feel empowered to create great digital marketing content, so let us know if we can help!

For a limited time get Campaign Donut for free

Want to Try Campaign Donut?

We’ll send you a complimentary promotional code. With it, you can enjoy a 30-day trial of Campaign Donut, absolutely free!

Check your email inbox or spam folder for your promotional code.