Now that you have removed the date from your WordPress URLs, you will need to set up proper 301 redirects. As we said, this will stop your users from seeing 404 error messages when they follow an old link.
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.
Do you want to remove the date from your WordPress URLs?
WordPress comes with an SEO-friendly URL structure. This includes several link formats, including one that adds dates to your WordPress post URLs.
Both of these issues can be fixed by setting up redirects, and we will show you how to do that later in this article.
If you were using ‘Month and name’ permalinks, then you will enter the following values:
Source URL: /(d*)/(d*)/([A-Za-z0-9-*])
Target URL: /$3
The source URL will describe the old URL permalink structure, and the target URL will describe the new post URL permalink you need to redirect to.
First, you need to install and configure the AIOSEO Pro plugin on your website. For more information, please refer to our step-by-step guide on how to set up All in One SEO correctly.
Changing the URL structure may result in 404 errors for your users and search engines. This means you might see warnings and errors in your Google Search Console reports.
The plugin will now redirect users to your new name-based URLs.
These URLs are better than the default ugly URLs, and they are SEO-friendly as well. However, they are unnecessarily long, and in time, the dates will make your articles look old.
If you are starting a new WordPress blog and haven’t launched it yet, then it is safe to remove the date from WordPress URLs.
The plugin will then run some tests, and if everything looks good, then you can click on the ‘Finish Setup’ button followed by the ‘Ready to begin!’ button. The plugin settings will be stored in the WordPress database.
This uses the post ID in the URL, which doesn’t look good and isn’t very meaningful.
Your redirect will be created. Now, if a user clicks on a link that uses your old permalink structure, then they will be automatically redirected to the correct post using the new name-based URL.
Plus, your search engine rankings may be affected since backlinks to your old articles will also now lead to 404 errors.
We hope this article helped you learn how to easily remove the date from WordPress URLs. You may also want to see our guide on the most common WordPress errors and how to fix them, as well as our expert pick of the best WordPress SEO plugins.
The plugin will then show you a couple of options. It can automatically detect and alert you if a post’s URL is changed and keep a log of redirects.
You’ll now see the ‘Redirects’ tab in All in One SEO, where you can add your first redirect.
Note: You will need AIOSEO Pro to use the redirection manager. There is also a free version of AIOSEO, but it doesn’t include 301 redirects.
https://example.com/2023/09/sample-post/
In this article, we will show you how to easily remove the date from your WordPress URLs.
Why Dates Appear in WordPress URLs
Upon activation, you need to visit Tools » Redirection and click on the ‘Start Setup’ button.
However, if your website has been around for some time, then there are a few things you should keep in mind.
You can see your redirect by scrolling down to the logs section. You can see how many website visitors have been redirected in the ‘Hits’ column, and you can enable or disable the redirect using the ‘Enabled’ toggle.
Method 2: Setting Up Redirects Using Redirection (Free)
By default, WordPress uses a non-human-readable link structure for post and page URLs, which looks like this:
The best way to set up redirects is using the All in One SEO (AIOSEO) plugin. That’s because it includes a powerful Redirection Manager feature that lets you create bulk 301 redirects as well as automatic redirects, full site redirects, 404 error tracking, and more.
‘Post name’ permalinks don’t include any date information in the URL:
That’s why a lot of users prefer the ‘Post name’ URL structure instead. This removes the date and just uses the post slug keyword in the URL.
After that, you need to visit the Settings » Permalinks page and choose ‘Post name’ as your permalink option.
https://example.com/2023/09/03/sample-post/
First, you need to create a complete WordPress backup of your website. This will allow you to restore your website to an earlier stage in case things don’t work out as you expected.
WordPress will now remove the date from your WordPress URLs and only use the post name. It will do this both for your existing posts and pages and those you will add in the future.
Setting Up Redirects to Preserve SEO Rankings
Don’t forget to select ‘Regex’ from the drop-down menu before you click the ‘Add Redirect’ button to save your changes.
https://example.com/?p=123
‘Month and name’ permalinks include the year and month:
However, if you were using ‘Month and name’ permalinks, then you will need to enter these Regex values instead:
Source URL: ^/(d*)/(d*)/([A-Za-z0-9-*])
Target URL: /$3
Once the plugin is active, you will need to go to All in One SEO » Redirects in your WordPress dashboard and then click the ‘Activate Redirects’ button.
We will cover 2 methods you can use to create 301 redirects in WordPress:
Setting Up Redirects Using AIOSEO (Recommended)
Setting Up Redirects Using Redirection (Free)
Method 1: Setting Up Redirects Using AIOSEO (Recommended)
This URL structure is shorter, meaningful, SEO friendly, and won’t look dated.
Considerations Before Removing the Date From WordPress URLs
You will also need to click the cog icon next to the source URL to display three checkboxes. Make sure that only the ‘Regex’ box is checked. This option will enable regular expressions in the source and destination fields.
To do this, we will use regular expressions, which are also known as Regex. Regular expressions provide a powerful and flexible way to search and manipulate specific patterns of characters. We will use them to match the permalink pattern in the URLs we need to redirect.
If you were using the ‘Day and name’ permalinks, then you will enter the following values in the source and target fields:
Source URL: /(d*)/(d*)/(d*)/([A-Za-z0-9-*])
Target URL: /$4
On this page, you will see settings where you can enter a ‘Source URL’ and ‘Target URL’.
Once you have added the source and target URL values, you should make sure that the Redirect Type is ‘301 Moved Permanently’ and then click the ‘Add Redirect’ button.
You will now see the plugin’s settings page. From here, you need to click on the ‘Add New’ button at the top of the page or simply scroll down to the ‘Add new redirection’ section.
You can choose our second method if you prefer to use a free plugin.
Some WordPress users choose the ‘Month and name’ or ‘Day and name’ options. These add date parameters to your WordPress URLs.
https://example.com/sample-post/
You can also leave both these options unchecked and simply click the ‘Continue’ button.
These redirects will send users to the updated URLs without showing a 404 error. This will also help search engines understand that the old URLs have been moved to the new URLs.
If you were previously using ‘Day and name’ permalinks, then you need to enter these Regex expressions into the source and target fields:
Source URL: ^/(d*)/(d*)/(d*)/([A-Za-z0-9-*])
Target URL: /$4
‘Day and name’ permalinks include the year, month, and day like this:
Don’t forget to click on the ‘Save Changes’ button at the bottom of the page to store your changes.
You will see a form with ‘Source URL’ and ‘Target URL’ fields. The source URL will describe the old URL structure, and the target URL will describe the new URLs.
First, you need to install and activate the Redirection plugin. For more details, see our step-by-step guide on how to install a WordPress plugin.
Luckily, the WordPress Settings » Permalinks page lets you easily change these default links to something more meaningful and SEO-friendly.
Changing the URL structure will also reset your social share counts. Unfortunately, most social share count services do not track redirected URLs and will reset the counts.