If you started your blog using the /%year%/%monthnum%/%postname%/ or the /%year%/%monthnum%/%day%/%postname%/ permalink structure, at some point you’ll likely want to change it to remove the date. Having a date in the URL of your post dates the post, and some people might dismiss a very relevant article if it’s dated 2010.
Fortunately, it is possible to remove the dates from your WordPress permalink structure without causing any 404 page errors or breaking your image links. You’ll need to follow just two (fairly) simple steps.
Before you start, make sure you have FTP or File Manager access to your site. You’ll need to edit your .htaccess file. If you do not have access to your .htaccess file, then don’t make any changes to your permalink structure until you do. Changing your permalink structure without redirecting your old links will cause massive 404 errors, which will hurt your blog’s SEO performance.
Go to your Dashboard, then Settings > Permalinks. Select the fourth option – “Post name”. Make sure you hit the blue “Save Changes” button.
Next, you’ll need to modify your .htaccess file to tell your site to redirect your old permalinks to your new permalink structure. First, make sure you have a back-up of your original .htaccess file. These can be fickle and you want to make sure you can revert back if needed.
The easiest way to generate the correct redirection code is to use Yoast’s .htaccess redirect generator. After you fill in the information, click “Generate Redirect”, and it will spit out the code you will need to place at the top of your .htaccess file.
Save or upload the modified .htaccess file to your server. Clear all site caches (for example WP Super Cache or W3 Total Cache.)
By following these steps, your site should now use the new post name only permalink structure and properly redirect your old URLs to their new links.