This month I did something really cool which is to change WordPress permalinks. I decided to switch from the usual month and year based permalink structure to a simpler one based on just the post name. The transition looks like www.ifindhub.com/2018/07/myposttitle.html to www.ifindhub.com/myposttitle.html
If you look at the two closely, the latter actually has a good aroma.
Before taking this step of changing my post permalink structure, I had to make a lot of considerations which includes:
- Talking to experienced WordPress users, especially my friend @Collins
- Reading several articles online related to changing WordPress permalinks, especially from Yoast and TechTage
- And finally resolving to take that great leap.
So, I actually looked very well before leaping.
Before I changed the structure form of the permalinks in my WordPress settings, I knew it would cause a lot of 404 errors on the old links because there have been tweaked. This is in fact what causes a lot of SEO errors which isn’t good at all.
So, I had to be cautious to make sure all was ready before diving into the deep blue sea.
Guess what, it all went well. And the good thing is that I am going to take you through all the steps I followed to achieve this.
Before going into the quick tutorial in full, let me give you some reasons why the post name permalink structure is really trending and good for SEO.
- It is kinda shorter and straight to the point
- The Year Month permalink structure mostly gives users a bad impression if your published date is too old.
Imagine doing a search on Google about the best car insurance companies in 2018 and Google shows you an article on the first page that was published around 2008.
A lot of people would skip it intentionally and go for those without dates or with recent dates. It’s the sad truth.
- The post name permalink structure gives you more space to add your desired/relevant keywords that would have been stolen by the year and month permalink structure.
- The year month permalink structure also negatively affects your page rank.
Here’s how permalink/URL structure can affect your site’s page rank on a search engine.
There are other WordPress post permalink structures apart from the post name structure, but the most suitable one remains the post name structure.
I won’t fail to say the worst WP permalink structure I would ever use is the year month & name, numeric, and plain.
So let’s begin.
How To Change WordPress Permalinks Without Breaking Old Links
This guide is intended to be as simple as possible. WordPress permalink structures include different styles, but this tutorial is basically for the %post name% permalink structure. Those moving from blogger to WordPress mostly use this structure initially to fix the blogger to WordPress redirect.
Make sure you follow the tutorial as described until the end and you will be glad you achieved something exciting.
If you can or feel like, you might put your site in a maintenance mode during the whole process by using WordPress maintenance mode plugins.
So let’s see how to change WordPress permalinks without losing traffic.
Step 1:
Select the %postname% Structure in the WordPress ‘Permalink Settings’
All you have to do is:
-
- Login to your WP dashboard, probably in another tab
- Move your mouse to Settings and select Permalinks from the drop down options
- Now select the %postname% permalink structure
- Scroll down and select Save Changes
Step 2:
Use Yoast’s Redirects Generator
Now that your permalink structure has been changed, you need to get a code that will redirect all your older posts to the new post name structure to avoid losing some link juice.
You are going to make use of Yoast’s Redirects Generator.
-
-
- Click on the link above
- In the space provided, enter your site’s URL.
- Specify if your blog is running in a subfolder (such as /blog). If not, leave it empty.
- Select your old URL/permalink structure by selecting one of the given formats.
- Enter your email address in the box at the bottom.
- Then click on Generate Redirect to get the redirect code.
-
The code might look like this, depending on your preferences:
Step 3.
Adding the Redirect code to your site’s .htaccess file
This step is also straightforward. All you are to do is to add/paste the code snippet you generated above to your site’s .htaccess file.
This file is found in your sites/server/WordPress installation. You can access it via CP (Control panel) or FTP(File Transfer Protocol) like File Zilla or any other one you are used to.
If you are new to this, you should backup your .htaccess file before proceeding so you can reverse any changes that didn’t work out as intended.
Also, check if your .htaccess file is hidden and enable viewing of hidden files in your WP installation folder.
So, these are the steps to follow to add the redirect code to your .htaccess file.
-
-
- Login to your site’s control panel via FTP or CP. For this tutorial, I am doing it via the Control Panel.
- Click on File Manager
- On the Preferences window, check the option Show Hidden Files (dotfiles)
- Locate your .htaccess file
- Click the necessary option to edit the file via the code editor or notepad if you are using an FTP client
- Paste the generated code at the top of your .htaccess file as instructed
- Once the code has been successfully pasted, click on Save code or overwrite the previous .htaccess file with the one you edited via FTP.
-
And am happy to announce to you that you just finished a great job that will positively affect your site and SEO as well.
Let’s troubleshoot some common issues that may arise.
Your permalink structure has changed, your sitemap should be updated in search engines as well
Since your entire site’s permalink structure has been updated, it’s a good idea to tell search engines that you actually did a cool job and they should stick to it. Even if you don’t, search engines will naturally adjust to it because your older posts are still being redirected to the new permalink structure.
So, get your sitemap updated or generated and follow the usual process in Google search console or the search engine you want to add your sitemap.
You can get this automatically done via Yoast Premium plugin or Google XML Sitemaps WP plugin.
So once you do that, you are good to go.
You might get 404 errors because your old URLs have .html extensions while your new post name structure doesn’t
Like mine, I noticed I was getting 404 errors on all of my old URLs because they all had a .html extension while the new permalink structure doesn’t.
It was scary at first but I fixed it using this simple steps.
-
-
- Go to your WP dashboard
- Hover on Settings and click on Permalinks
- Now edit the post name structure to look like this
- Click on Save Changes as well to save your new settings
-
You are now done. Rejoice and keep optimizing your site for better SEO.
Hope you find this useful like I did when I first read the short guide at Techtage. Don’t forget to turn off the maintenance mode if you activated it before the whole process.
You might also like to read:
Now, this is amazing.
Great content I must say. I was able to make all appropriate changes.
Thank you.
? You are welcome bro. It’s good to see everything working well. Don’t forget to share the post.
Thank you for such a detailed guide, I was able to apply this on my new relationship blog and everything worked fine.
Thanks 🙂