Keeping your website up to date is essential for professionalism, and one small but important detail is your copyright year in the footer. Instead of manually updating it every year, you can set it up to update automatically using a simple code snippet.
This guide will show you how to update your WordPress copyright footer for classic widgets, Gutenberg widgets, and Elementor. Keep in mind that some themes and plugins may have different settings, but the general approach remains the same.
Why Update Your Copyright Year Automatically?
- Saves time: No need to remember to update it every January.
- Improves credibility: An outdated copyright year may make your site look neglected.
- Ensures accuracy: Avoid giving visitors the impression that your content is outdated.
PHP Code for an Automatic Copyright Year
To display the current year dynamically, use this PHP snippet:
© <?php echo date('Y'); ?> Your Website Name. All Rights Reserved.
This code ensures that the copyright year updates automatically without any manual changes. Now, let’s go through how to implement this code in different WordPress setups.
Updating Copyright Year in Classic Widgets (Legacy Widgets)
If your theme allows you to edit the footer widget via Appearance > Widgets, follow these steps:
- Go to Appearance > Widgets in your WordPress dashboard.
- Locate the footer widget area where your current copyright text is displayed.
- If it uses a Text Widget, replace the existing copyright text with:
© <span id="year"></span> Your Website Name. All Rights Reserved. <script> document.getElementById("year").textContent = new Date().getFullYear(); </script>
- Click Save and check your website footer to confirm the update.
Since text widgets don’t support PHP directly, we use JavaScript to insert the current year dynamically.
Updating Copyright Year in Gutenberg Widgets
If your theme uses Gutenberg block widgets, follow these steps:
- Navigate to Appearance > Widgets.
- Locate the footer widget area.
- Add a Custom HTML block.
- Insert the following code:
© <span id="year"></span> Your Website Name. All Rights Reserved. <script> document.getElementById("year").textContent = new Date().getFullYear(); </script>
- Click Update and check your site to confirm the changes.
Again, JavaScript is used here since PHP is not supported in widget areas.
Updating Copyright Year in Elementor Free
If you are using the free version of Elementor, follow these steps:
- Open your WordPress dashboard and go to Appearance > Widgets or Templates > Theme Builder > Footer (if your theme supports footer templates).
- Select the footer section and open it in Elementor.
- Drag and drop a Text Editor widget into your footer area.
- Enter the following text:
© <span id="year"></span> Your Website Name. All Rights Reserved. <script> document.getElementById("year").textContent = new Date().getFullYear(); </script>
- Click Update and check your site to confirm the automatic update.
Elementor Free does not support PHP code, so JavaScript is the best way to ensure the year updates automatically.
Alternative Methods for Different Themes and Plugins
- Some themes have a built-in copyright field under Appearance > Customise > Footer where you can enter HTML.
- Some premium themes or page builders like Elementor Pro allow dynamic tags, so you can use {{current_year}} to display the year.
- If your theme uses a hardcoded footer.php file, you may need to edit it via Appearance > Theme File Editor > footer.php and insert the PHP code.
Setting up your WordPress copyright footer to update automatically is a small but effective way to keep your site looking fresh and professional. Whether you’re using Classic Widgets, Gutenberg, or Elementor, you can implement the solution that best fits your setup.
If you need help with website updates, feel free to get in touch!