Want to know how to display today’s date in WordPress?
Of course you do. That’s why you are here and that is exactly what we are going to show you how to do.
We know there are many reasons why you would want to display today’s date on your WordPress site.
For example, many blogs, online magazines, and news websites display the date to assure visitors that the articles they are viewing are recent. Another reason would be to show the current day and time on the live chat features and countdown timer.
Whatever your specific reason for wanting to display today’s date in WordPress, we’ll show you three easy ways How you can do it: Using a plugin, writing your own code, or choosing a shortcode.
Let’s dive into it, shall we?
Why show today’s date in WordPress
You’ve probably noticed that many news magazines and other online sources add dates to their blog posts. This is because there are many benefits to displaying dates in WordPress. Let’s take a look at some of them:
- freshness: Showing the current date on your website can make it look more up-to-date and relevant to your visitors. This can help build trust with your audience and keep them coming back for new content. However, you have to be consistent with your uploads if you want this to work, as there’s no point in adding dates if you don’t plan to post regularly.
- time-sensitive content: If you publish time-sensitive content, such as news articles or event listings, displaying the current date can help visitors determine the relevance of the content. Your readers will see that you are covering the latest news, which makes your source more credible.
Now that we’ve covered why this can be beneficial, let’s look at all the steps required to display today’s date in WordPress.
Easy Ways to Display Today’s Date in WordPress
The first thing we should mention is that WordPress itself does not come with a widget or block that will allow you to automatically add the current date to your posts or pages. This is why many people have turned to writing their own simple code or using specialized tools to do this. You don’t even need much knowledge to do it yourself.
Although there are more complex ways to display today’s date in WordPress, we will show three of the most common and popular methods below. Let’s start with the easiest: using a plugin made specifically for this purpose. If you prefer to avoid plugins (many do), keep reading to see how you can write your own custom code and shortcode to display today’s date.
Method 1: Insert Today’s Date Anywhere Using a WordPress Plugin
A straightforward way to display today’s date on your WordPress website is by using the plugin method. By this, we mean installing a plugin that creates a widget or component that you can use on different pages or templates.
There are a few different options out there, but for this article, we’ll focus on how to display dates using the free WP Date & Time Shortcodes plugin.
To use this plugin:
- Install WP Date & Time shortcode by navigating to plug-in add new From your Dashboard, by searching for its name, and clicking establish,
- activate the plugin from plug-in Menu.
- Simply paste any of the included shortcodes anywhere on your post, page, or template, and they’ll work flawlessly.
Here are some examples of usage of this plugin:
[wpdts-date-time]– This shortcode will show the default date and time format as seen on your WordPress general settings.[wpdts-date]– Default date format.[wpdts-time]– Default time format.
You can also customize the format of the date using the shortcode parameters available. More in the plugin’s docs.
Method 2: Enter today’s date using custom code
You don’t need to be a programmer to use Simple PHP Code. In fact, there is a surprisingly simple line of code that can display today’s date using the date format you have in your WordPress settings. Here it is:
<?php echo date(get_option('date_format')); ?>
So, where do you need to add this bit of code? Unlike a shortcode, which can be pasted into any WordPress post or page, this piece of PHP code can only be used within your theme files. You can visit these files Presence theme file editor from your dashboard.

If you want to change the way the date is displayed (for example, the order of the day and month), you can do so by going to your Settings page (Adjustment Common,
Method 3: Insert the current date using the custom shortcode
The method we just covered, writing your own code, limits where you can display the date as it can only be pasted into theme files. If you want to add your own date widget or block to a post or page, you can write your own shortcode instead.
To do this, the first step is to create the shortcode itself. Then, you can either put that code in your functions.php Set it up via a custom code snippet using a file or the Code Snippet plugin (recommended).
The shortcode itself is this:
add_shortcode( 'date-today', function ($atts) {
return date(get_option('date_format'));
} );
Once you have defined the shortcode either in the Code Snippets plugin or in your functions.php file, you can use the following shortcode to display today’s date anywhere on your site:
[date-today]
If you change the formatting of the shortcode within your post (for example, you make text bold), this will be applied in the front end as well.
final thoughts
Learning how to display today’s date in WordPress is a useful thing that you can learn quickly and easily. There is no single way to do this, so you can choose from several equally effective methods.
Whether you decide to use the wp date and time plugin to create a custom shortcode, or come up with a manual code, we hope this guide will help you achieve the desired result.
Once you have implemented the necessary steps, you will be able to enjoy all the benefits of showing the date and time on your WordPress posts. Not only will the content look fresher, but it will also be more organized.
