This article is all about WordPress Current Year Shortcode – a guide to display the current year in your WordPress website content using a simple shortcode.
In this article, I will article, we are exploring 2 easy methods to show 2025, which updates dynamically when the year changes via:
- Using a WordPress shortcode plugin – AIO Shortcodes
- Without plugin (old method via functions.php file)
The first method is our favourite way to get current year using a WordPress shortcode that also best fits the option for non-codes.
Now let’s get started.
2 Easy Ways To Display Current Year in WordPress Using A Shortcode
To get started with the tutorial, I would like to tell you how I display 2025 or current year number using a shortcode on my website. This is also the first method we recommend strongly.
Method 1: Install AIO Shortcodes

We built AIO Shortcodes (the best WordPress shortcode plugin in 2025) for adding dynamic content to easier for bloggers, especially non-coders.
I don’t want to get into details here about the plugin AIO Shortcodes and it gives you instant access to 100+ dynamic shortcodes that let you automate your content and keep it up to date.
Once you have installed AIO Shortcodes plugin, just place the shortcode, just place the shortcode [aio_year] and save your post/page. It will get current year data and update automatically.
This is what you write in the post editor:

And this is what display to your website readers:

The best part is that you have to place the year shortcode once only, and will keep your current year number up to date forever.
Here are the best possible year shortcodes offered by AIO Shortcodes:
- [aio_year]: Output current year like 2025 – the default format
- [aio_year go="3"]: Output 3 years after the current year like 2028
- [aio_year go="-2"]: Output 2 years past the current year like 2023
There are many more additional options available for AIO’s current year shortcode that you can read on our docs year page.
Bonus: Do you want to display the current month like “February“? Use out our WordPress shortcode [aio_month].
Method 2: Get Current Year In WordPress Without Plugin
If you prefer to avoid adding another plugin to your WordPress site, there’s a straightforward method to automatically display the current year using a shortcode.
Let’s dive into it.
Note: This method requires custom code addition to your theme’s functions.php file. Thus, using a child theme when editing the functions.php file is advisable to avoid losing modifications during theme updates.
The first step is to navigate to your WordPress dashboard, head to Appearance » Theme File Editor, and select the functions.php file from the list of theme files on the right.

Next, add the following PHP code at the bottom of your theme code editor functions.php file. This file is used to add theme functions inside your WordPress theme.
function current_year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'current_year_shortcode');
This simple code snippet creates a shortcode [year] to output the current year.
Note: In the PHP code above, the yellow text is the name of the shortcode. You can rename it at your convenience.

Finally, click the Update File button at the bottom to save the code.
Now, your current year shortcode, [year], is ready to use within your WordPress posts and pages.
To use the shortcode, go to any post or page, and inside the content editor, place [year] and save it. It will automatically get and display the current year number, which will remain automatically updated.
Following these steps, you’ve successfully added a dynamic way to display the current year without relying on an additional plugin.
FAQs – Frequently Asked Questions
Have questions about the current year shortcode in WordPress? Check out these common queries:
What is a shortcode?
In WordPress, a shortcode is a simplified code enclosed in square brackets like [shortcode], used to execute predefined functions or display dynamic content with minimal effort.
How to get the current year in WordPress with a plugin?
Simply install a WordPress shortcode plugin like AIO Shortcodes, and use the provided shortcode, such as [aio_year], to effortlessly display the current year in your content.
How to display the current year in WordPress without installing a plugin?
You can add a PHP shortcode directly to your theme’s functions.php file without installing a plugin. For instance, [year] can display the current year.
Can I display past and future years with WordPress shortcodes?
Absolutely! AIO Shortcodes offers versatility, allowing you to display the current year, past years, and future years. For example, [aio_year go="5"] shows the year five years ahead.
Is AIO Shortcodes suitable for non-coders?
Yes, AIO Shortcodes is designed to be user-friendly, making it a perfect fit for bloggers and individuals without coding expertise.
How often do AIO Shortcodes update the displayed year?
AIO Shortcodes automatically update the displayed year, ensuring your content remains current without manual intervention.
Can I short the current year on the post title?
Yes! You can use our shortcode [aio_year] to display the WordPress current year in posts and page titles.
How to display the copyright symbol with the current year in footer widgets?
Use our copyright © shortcode [aio_c] and year shortcode [aio_year] together to output custom copyright footer text, such as:
[aio_c] [aio_year] outputs symbol of copyright + year like © 2025
[aio_year] [aio_c] outputs year +copyroght symbol like 2025 ©
Final Thoughts On WordPress Current Year Shortcode Tutorial
We hope that this article has helped you find a straightforward and effective way to easily display the current year on your WordPress website with a shortcode.
For those aiming for simplicity and customizable attributes, AIO Shortcodes stand out. With features like displaying current, past and future years, this plugin streamlines the process, making it accessible to all users.
Install AIO Shortcodes today for a hassle-free experience, ensuring your content stays fresh effortlessly. Cheers to a more dynamic and engaging WordPress website!