It is very important to keep your WordPress website updated so that the website works well and people have a good experience.
A simple and beneficial way is to display today’s date on your site.
Whether you are running a blog, news website or an online store if the current date is visible on the website, people feel that the website is fresh and alive.
In this guide, we will tell you two simple ways through which you can show the current date on your WordPress site.
The first way is by using a little code, and the second way is through short codes which is even easier.
By the end of this post, your website will be looking at today’s method which your visitors will definitely like
Want to stay ahead with AI-driven in WordPress insights and stay updated with the latest trends? Subscribe for daily search insights at wpguidepro.com to improve your WordPress strategy.
Table of Contents
Why Display Today’s Date in WordPress?
Showing today’s date can be very beneficial for your website. How? See below:

User experience is better
When people visit a website, they want all the information to be new and real. If it is showing today’s date, it feels that the website is fresh.
Perfect for timely content
If you write news or blog, it is important to show the date. This helps people understand when the article was written – and this makes the website more trustworthy.
Website seems more active
If it is showing today’s way, then the website does not seem static (unknown), rather it seems that something new is going on.
People trust it more
Showing today’s way shows that the website is professional. New people think that this website is not old or abandoned.
Now that you have understood why this is important, let’s see how it is done
Method 1 Adding Code to Your Theme’s Template File
If you know a little bit about coding, you can show yourself how to insert code into the files of your WordPress site. Here is a step by step guide on how to do it:
Reaching your WordPress Theme Files
First of all, you have to reach the theme files of your website:
- Login to WordPress Dashboard.
- Click on Appearance > Theme Editor.
- Now select the file where you want to display the date (eg: header.php, footer.php or sidebar.php).
Pro Tip: Make sure to create a backup copy of your theme, so that if something goes wrong you don’t lose your data.

Add the PHP code to display the date
Now paste the code given below where you want to display the date:
<?php echo date('F j, Y'); ?>
This code will display today’s date in this format: “Month Day, Year”

Like: October 15, 2023
You can also change the format:
- F j, Y: October 15, 2023
- m/d/Y: 10/15/2023
- D, M j: Sun, Oct 15
Paste the code where you want the date to appear like at the top of the page or in the header.
Save Changes
Once you have entered the code, click on the Update File button below.
Then refresh your website and see if the current method looks correct or not.
Note: This method is for those people who know a lot about PHP and WordPress theme editing. If you are not comfortable with it, then use the other (easier) method which is short code.
Method 2 Using Shortcode to Display Today’s Date (Recommended)
By using shortcodes, you can display today’s date anywhere on your WordPress website without editing files. This method is very easy, especially for beginners.
Step 1: Add the shortcode-creating function to your theme
You will have to add a small function to the functions.php file of your website.
How to do it:
- Go to WordPress Dashboard
- Click on Appearance > Theme Editor
- Open the functions.php file
Paste the following code at the end of that file:
function displaytodaysdate() { return date('F j, Y');
} add_shortcode('todays_date', 'displaytodaysdate');
This code creates a shortcode named: [todays_date]
Step 2: Save the file
Once you add the code, click on the Update File button below to save the file.
Step 3: Use the shortcode on your website
Now wherever you want, just write this: [todays_date]
Where can I use it?
- In any blog post or page
- In the sidebar or footer text widget
- Even inside the custom HTML block
Bonus Tip: If you want to change the style of the date (like 10/15/2023 or Sunday, Oct 15), then change the format inside the date() function just like the first method
Expert Guides on Displaying Dates in WordPress
Want to make your date display even better? Here are some advanced tips that can take your WordPress site to the next level:
Add Dynamic Language or Timezone
If people from different countries view your website, you can add a system to display the date according to their language or timezone.
Make the Date Stylish (With CSS)
You can add style to make the date look even better. Like this CSS code:
.date-display { font-size: 16px; color: #333; margin-top: 10px; }
To add this code go to
Appearance > Customize > Additional CSS And paste this code there.
Using Plugins (No Coding Required)
If you don’t want to do coding then you can use WordPress plugins which help in showing the date. Some popular plugins are:
- WP Date and Time Shortcode
- Insert Date
- Custom Post Type UI
Adding Fun Features with Date
- Not just date, you can also add other features like:
- Event Calendar (to show events)
- Countdown Timer (to show time till a special event)
- These features make your site more interesting.
Way to keep changes safe even after theme update
If you have manually edited template files (like header.php) then always use Child Theme. This will ensure that your code will not be deleted when the theme is updated.
Start Updating Your WordPress Site Today
Nowadays, it may seem like a small thing to display on your WordPress website, but it improves the user experience and earns people’s trust.
Whether you code manually or use a simple shortcode, this feature can be added easily.
Want to learn more about WordPress?
Check out our expert guides and tutorials so you can improve your website’s design and features.
Have any questions?
Ask in the comments below we’re ready to help! 😊