Codepen Blog
  • Home
  • About us
  • Contact us
Codepen Blog
  • Home
  • About us
  • Contact us
Friday, December 19, 2025
Top Posts
Top 10 AI Logo Generators in 2023 with the Majority Being...
Ultimate Guide to install and setup WordPress multisite
Upload WordPress From localhost to live server in 2024
Top 10 Best WordPress Themes for Woocommerce in 2024
Top 11 WordPress Mobile Plugin for Optimal Usage in 2024
The Ultimate Guide to Self-Hosted WordPress Website
SSH-ing into a Docker container: a step-by-step guide
Creating a Complete Homepage Using Divi AI – Step by Step...
How to use ftp or sftp server to transfer files in...
Top 5 hosting to WordPress Staging Site with plugins in 2024
SUBSCRIBE NEWSLETTERS
Codepen Blog
Codepen Blog
  • Contact us
Copyright 2021 - All Right Reserved
Blogs

Adding a Dynamic Copyright Date to your WordPress Footer: A Step-by-Step Tutorial

by developershohel August 15, 2023
written by developershohel August 15, 2023 Pay Writer
292

Keeping your website’s copyright date accurate is a small but essential detail that reflects professionalism and shows your audience that your site is actively maintained. It sends a message to visitors that your website is current and trustworthy.

Table of Contents

Toggle
    • Why Add a Dynamic Copyright Date in the WordPress Footer?
    • Method 1: Add Dynamic Copyright Date Using WPCode (Recommended)
    • Method 2: Add Dynamic Copyright Date to WordPress Footer Using Auto Copyright Year Updater
  • Pay Writer
You Might Be Interested In
  • Important Statistics to be Aware of in 2023
  • The Ultimate Guide: Optimal Instagram Posting Times in 2023
  • Generating Business Leads through Inbound Strategies: A Beginner’s Guide
  • Top 10 Swiftest WooCommerce Themes Expected in 2023
  • Avoid Falling Into the Trappings of Hustle Culture
  • 3 Easy Methods for Creating an Alert Bar in WordPress

By adding a dynamic copyright date to your website’s footer, you ensure it automatically updates each year. It’s an easy way to improve your site’s credibility and make a positive impression on your audience.

At WPBeginner, we use a dynamic copyright date in the footer of all our websites. It automatically updates as the year changes, saving us the hassle of manually updating it across multiple sites.

In this article, we will show you how to easily add a dynamic copyright date in your WordPress website’s footer.

Adding dynamic copyright date in WordPress footer

Why Add a Dynamic Copyright Date in the WordPress Footer?

A copyright date typically covers the current year or range of years in which the content, design, and code of your WordPress website are protected by copyright laws.

The copyright date on your website should be current, but manually updating it takes time, and you might forget to do it.

That’s where a dynamic copyright date can help. It will automatically update to ensure that the date is accurate and meets the copyright laws of different countries.

It also helps protect your content from copyright infringement and plagiarism.

Plus, an updated copyright date signals to search engines that your site is well-maintained and active. This can help improve search engine rankings and attract more traffic to your website.

In this article, we will show you how to easily add a dynamic copyright date in the WordPress footer. You can use the quick links below to jump to the method you want to use:

  • Method 1: Add Dynamic Copyright Date Using WPCode (Recommended)
  • Method 2: Add Dynamic Copyright Date to WordPress Footer Using Auto Copyright Year Updater

Method 1: Add Dynamic Copyright Date Using WPCode (Recommended)

If you want to generate a dynamic copyright date that covers all the years from the start of your WordPress blog until the current year, then this method is for you. It works by using the published date of your oldest post and your newest post.

To add a dynamic copyright date to your WordPress footer, many tutorials will tell you to add custom code to your theme’s functions.php file. However, the smallest error while typing the code can break your website.

That’s why we recommend using WPCode, which is the best WordPress code snippets plugin on the market. It is the easiest and safest way to add code to your website.

First, you will need to install and activate the WPCode plugin. For more instructions, you may want to see our beginner’s guide on how to install a WordPress plugin.

Note: You can also use the free WPCode plugin for this tutorial. However, upgrading to the Pro version will give you access to a cloud library of code snippets, smart conditional logic, and more.

Upon activation, just visit the Code Snippets » + Add Snippet page from the WordPress admin sidebar.

From here, go to the ‘Add Your Custom Code (New Snippet)’ option and click on the ‘+ Add Custom Snippet’ button under it.

Adding a new custom code snippet in WPCode

Next, you need to select ‘PHP Snippet’ as the code type from the list of options that appear on the screen.

Select the PHP snippet option

This will direct you to the ‘Create Custom Snippet’ page, where you can start by typing a name for your code snippet.

Keep in mind that this name won’t be displayed on the front end and is only used for identification purposes.

Enter a title for the dynamic copyright date code

Once you have done that, copy and paste the following code into the ‘Code Preview’ box:

123456789101112131415161718192021222324252627if( ! function_exists( 'wpb_copyright') ) {    functionwpb_copyright() {        // Cache the output so we don't have to run the query on every page load.        $output= get_transient( 'wpb_copyright_text');        if( false !== $output) {            // Return the cached output.            return$output;        }        global$wpdb;        $copyright_dates= $wpdb->get_results(            "SELECT YEAR(min(post_date_gmt)) AS firstdate, YEAR(max(post_date_gmt)) AS lastdate FROM $wpdb->posts WHERE post_status = 'publish'"        );        $output= '';        if( $copyright_dates) {            $output= '© '. $copyright_dates[0]->firstdate;            if( $copyright_dates[0]->firstdate !== $copyright_dates[0]->lastdate ) {                $output.= '-'. $copyright_dates[0]->lastdate;            }            // Set the value as a transient so we only run the query 1x per day.            set_transient( 'wpb_copyright_text', $output, DAY_IN_SECONDS );        }        return$output;    }}echowpb_copyright();

Hosted with ❤️ by WPCode

1-click Use in WordPress

Upon activation, this code will automatically fetch data and display your copyright date according to the oldest and newest posts on your website.

Next, scroll down to the ‘Insertion’ section and choose the ‘Shortcode’ method. We are using this method because we want to specifically add code to the WordPress footer.

Use the shortcode method

Finally, scroll back to the top and toggle the ‘Inactive’ switch to ‘Active’.

Once you have done that, just click the ‘Save Snippet’ button to store your settings.

Save the code snippet for adding dynamic copyright date

Now, you have to scroll back to the ‘Insertion’ section and copy the shortcode by clicking on the ‘Copy’ button next to it.

Keep in mind that you won’t be able to copy the shortcode until you have activated and saved the code snippet.

Copy the shortcode for the dynamic copyright date

Add Dynamic Copyright Date to the WordPress Footer Using a Widget

You now need to add the shortcode to your WordPress footer. This method is for you if you are using a classic theme without the full site editor.

Once you have copied the shortcode, head over to the Appearance » Widgets page from the WordPress admin sidebar.

From here, scroll down to the ‘Footer’ tab and expand it.

For this tutorial, we are using the Hestia Pro theme. Depending on the theme that you are using, your widgets page may look a bit different.

Next, you need to click on the ‘Add Block’ (+) button in the top left corner of the screen and look for the Shortcode block.

Upon finding it, add the block to the ‘Footer’ tab and then paste the WPCode shortcode into it.

Add shortcode into the footer tab

Finally, click the ‘Update’ button at the top to save your changes.

Now, you can visit your website to check out the dynamic copyright date in action.

Preview for dynamic copyright date in WordPress footer

Add a Dynamic Copyright Date in a Block-Based Theme

If you are using a block-based theme on your WordPress website, then you can use this method to add the copyright shortcode to the footer.

First, you need to visit the Appearance » Editor page from the WordPress dashboard. This will launch the full site editor on your screen.

From here, choose the Footer section and then click on the ‘Add Block’ (+) button in the top left corner of the screen.

Next, simply find and add the Shortcode block to your preferred area in the footer.

Once you have done that, paste the dynamic copyright date shortcode into the block.

Add copyright date shortcode into the FSE

Finally, don’t forget to click the ‘Save’ button at the top to store your settings.

You can now visit your website to check out the dynamic copyright date in action.

Copyright date in fse

Method 2: Add Dynamic Copyright Date to WordPress Footer Using Auto Copyright Year Updater

If you don’t want to use code on your website, then this method is for you.

First, you will need to install and activate the Smart Copyright Year plugin. For details, you may want to see our guide on how to install a WordPress plugin.

Disclaimer: Keep in mind that this plugin hasn’t been tested with the latest version of WordPress. However, when we used it for this tutorial, it seemed to be working fine. To learn more, see our guide on the use of outdated plugins.

Upon activation, the plugin will automatically fetch data for your copyright date. Even so, you must remember that it only displays the current year and does not show the range of years that the site has been used.

To display the copyright date, you will now have to add a shortcode to the website footer.

Add Dynamic Copyright Date in a Classic Theme

If you are using a classic theme that doesn’t use the full site editor, then you can use this method.

First, must visit the Appearance » Widgets page from the WordPress admin sidebar. Once you are there, scroll down to the ‘Footer’ tab and expand it.

For this tutorial, we are using the Hestia Pro theme, so your widgets may look a bit different depending on the theme that you are using.

Next, click on the ‘Add Block’ (+) button in the top left corner of the screen and find the Shortcode block.

Simply add the block to the ‘Footer’ tab and then copy and paste the following shortcode into it to display the copyright date like this:

[year]

Add plugin shortcode in the footer widget

Finally, click the ‘Update’ button at the top to save your changes.

Now, you can visit your website to check out the dynamic copyright date in action.

Copyright date preview

Add Dynamic Copyright Date in a Block-Based Theme

If you are using a block-based theme with the full site editor, then you can insert the dynamic copyright shortcode with this method.

You must head to the Appearance » Editor page from the WordPress admin sidebar.

Once you are there, choose the ‘Footer’ section and then click on the ‘Add Block’ (+) button in the top left corner of the screen. Then, look for and add the Shortcode block.

After that, add the following shortcode into the block to display the copyright date on your website:

[year]

Add plugin shortcode

Finally, click the ‘Save’ button at the top to store your settings.

Now, you can visit your website to see the dynamic copyright date in action.

Copyright date preview with plugin

We hope this article helped you learn how to add dynamic copyright dates in the WordPress footer. You may also want to see our tutorial on how to add dynamic content in WordPress and our top picks for the best Canva alternatives for website graphics.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Pay Writer

Buy author a coffee

Pay Writer
0 comments 0 FacebookTwitterPinterestEmail
developershohel

previous post
Creating a Net Promoter Score® (NPS) Survey on WordPress: A Step-by-Step Guide
next post
Mastering Laravel API Rate Limiting to Secure Endpoints

Related Posts

How to improve Website Performance & Speed Up...

February 20, 2024

10 Best WordPress Image Optimization Plugins in 2024

February 20, 2024

Top 5 hosting to WordPress Staging Site with...

December 29, 2023

Writing a Blog Post Using AI in WordPress...

August 20, 2023

10 Useful Ways to Utilize AI in WordPress

August 19, 2023

Ultimate Guide on How to Add 2FA Authentication...

August 18, 2023

Comparison of the Top 6 Best WooCommerce Shipping...

August 18, 2023

Top 7 Link Tracking URL Shorteners for WordPress

August 18, 2023

2 Simple Methods to Highlight Text in WordPress

August 18, 2023

Comparison of the Top 5 Managed MySQL Hosting...

August 17, 2023

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

* By using this form you agree with the storage and handling of your data by this website.

Weather

New York
heavy intensity rain
92%
9.8km/h
100%
13°C
14°
12°
12°
Fri

Recent Posts

  • How to improve Website Performance & Speed Up website

    February 20, 2024
  • 10 Best WordPress Image Optimization Plugins in 2024

    February 20, 2024
  • Top 10 Best WordPress Themes for Woocommerce in 2024

    January 1, 2024
  • How to use ftp or sftp server to transfer files in 2024

    December 30, 2023
  • Upload WordPress From localhost to live server in 2024

    December 30, 2023

STAY TUNED WITH US

Sign up for our newsletter to receive our latest blogs.

Get Best Web Hosting and Services for your Business

Hostinger

Hostinger

Bluehost

Bluehost

WP Engine

Name.com

Name.com

Resources

  • Developer Shohel
  • Url Shortener
  • All in One Online tools
  • Secure Cloud Storage
  • Books
  • Fashion Product
  • IT Blogger

Company

  • Privacy Policy
  • Refund Policy
  • Terms and Conditions
  • Cookie Policy
  • Contact us
  • About us

Most read

How to improve Website Performance & Speed Up website
February 20, 2024
10 Best WordPress Image Optimization Plugins in 2024
February 20, 2024
Top 10 Best WordPress Themes for Woocommerce in 2024
January 1, 2024
Codepen Blog | Top blogs for WordPress and Web Development
Facebook-f Twitter Instagram Linkedin Behance Github

@2024 – All Right Reserved. Designed and Developed by Developer Shohel

Codepen Blog
  • Home
  • About us
  • Contact us
Codepen Blog
  • Home
  • About us
  • Contact us
@2021 - All Right Reserved. Designed and Developed by PenciDesign

Read alsox

12 Simple Steps: A Guide to Posting...

July 27, 2023

Effective Strategies for Achieving Results Through Email...

August 8, 2023

Claim Your Free Esthetician Layout Pack for...

July 11, 2023
Sign In

Keep me signed in until I sign out

Forgot your password?

Do not have an account ? Register here

Password Recovery

A new password will be emailed to you.

Have received a new password? Login here

Register New Account

Have an account? Login here

Shopping Cart

Close

No products in the cart.

Return To Shop
Close