URL structure is one of the major factors that search engine considers while ranking your website. The URL of the post should also be optimized to make your website rank higher on the search engine result pages. By default, WordPress creates its structure of your post or pages which is known as the permalinks.
Every search engine links to this permalink while to help users find your website. Though you can change the URL of your site anytime you want, but that is surely not advised. Changing the URL will cause error 404 to the previous URL, which is cached by the search engines and will certainly drop the traffic on your website as well.
The default permalink structure of WordPress is similar to https://www.yourdomain/your-post-name. However, if you have multiple categories on your website, then the URL could look like https://www.yourdomain/category/categoryname.
You can quickly change this category prefix and remove it as well. Not only that, but WordPress also create a prefix in the URL for tags as well. Sometimes the website owner wants to change this default URL to something which supports their categories even further. If you are among those people, then here we mention you the complete procedure on how you can easily change the category base prefix.
Changing the category prefix is not as difficult as it sounds. All you need to do is head over to your WordPress admin dashboard and open the Settings > Permalinks page. You will see different permalink options, but you need to scroll down to the Optional section. In the Category Base section, enter the prefix you want to use and press the Save Changes button to keep this prefix.
Changing the default prefix will make changes in the URL as well. If your visitors try to open your old URLs, then they won’t receive any content and will only witness an Error: 404 Not Found error. The reason why this error occurs is that all your previous URL’s content has been shifted to your new URL.
This error will not only cause the ranking drop but can also result in the decrease in traffic as well. The solution to this plugin is by setting up redirections to the new URL. To redirect your visitors to your new URL, you need the Redirection plugin.
First, you need to head back to your WordPress admin dashboard and open the Plugin s> Add New page. Here search for the plugin and press the Install Now button. Once the installation is complete, you need to click on the Activate Plugin link, and the plugin will be ready to use.
After you have activated the plugin, you need to open the admin dashboard once more and head over to the Tools > Redirection page. You need to navigate to the Add New Redirection section where you will see fields like source URL, target URL, and group.
The first section will be the Source URL where you need to enter /category/ (.*). Select the URL only option in the Match section and Redirect to URL in the Action section. Make sure to enable the Regular Expression option and type in /yourcategoryprefix/ in the Target URL section. The last field will be the Group field where you need to select Redirections. After making all the above changes, you need to Press the Add Redirections button, and the plugin will save all the changes.
Some people believe that removing the prefix from the URL is beneficial for the website. However, it can cause more damage than good. By removing the prefix, you are not allowing the search engines to distinguish between your posts and pages which can cause rank drops in the search engines.
In addition to that, some of the pages could stop working, and you make face difficulties while using numerous plugins. The choice is up to you that whether you want to remove this prefix from the URL or not.
To remove the prefix, you need to install and activate the FV Top Level Categories plugin. You need to follow the same process which you performed to install the Redirection plugin. Upon successful activation, this plugin will automatically remove all the prefix from your URLs and will also work with the %postname% permalink structure.
The same Error: 404 Not Found will occur after activating this plugin. You can follow the same redirection process using the Redirection plugin and setup redirections. You need to disable the URL monitoring to avoid redirection errors.
If you don’t want to remove your website’s category base prefix using this plugin, then there are certainly other methods that you might consider.
#1 Using Yoast SEO
Yoast SEO is one of the most widely used SEO plugins for WordPress that you can use for removing the category base from your website. All you need to do is install and activate the Yoast SEO plugin and open its Advanced section. Here you will see three different tabs naming Breadcrumbs, Permalinks, and RSS where you need to open the Permalinks tab. There, you need to check the Strip the Category Base option and save all the changes. Now the plugin will remove the category prefix from your website URLs.
#2 Using the .htaccess File
Another way of removing the category prefix is by adding a specific code in the .htaccess file. This file is located in your core WordPress files.
The first thing you need is to connect with your FTP client and open your WordPress root directory. Once you have opened the WordPress files, you will see different folder and files including wp-content, and wp-admin. This is the place where your .htaccess file will be located, but you won’t be able to find it as it is hidden by default.
All you need to do is open the File menu and check the Show Hidden Files options. Once you enable this option, all the hidden files of your root directory will appear.
Once you have found the .htaccess file, you need to right click on it and press the Download button to download it on your local system. Now locate to the directory where you downloaded the file and open it using any text editor.
After opening the file, you need to paste this code into the file and save all the changes. This code will remove the category prefix from your URLs.
RewriteRule ^category/(.+)$ http://www.yourwebsite.com/$1 [R=301,L]
You have now added the code to the .htaccess file and save it to your system, but to reflect the changes on your website, you need to upload this file to your server. Login to your FTP client and open the WordPress directory. Now all you need to do is paste the edited .htaccess file here, and the changes will be now be saved to your servers.
Understanding all About Permalinks
You already know what permalinks are and how they are used on your website. In addition to that, the permalink is the only address that search engine considers to find your site making it one of the most important factors of your website. Now you know the complete procedure of changing the category base prefix which you can perform anytime you want. Changing the permalink structure is not a daunting task, but you need to make sure that you put the redirections so that the users won’t face an Error: 404 Not Found page.
Whenever you add a new post to your WordPress site, the program automatically creates a default permalink which you can change. The default permalink includes number and symbols which is simply poor for SEO. Apart from that, the WordPress gives you an option to choose from five different permalinks. Those options are the default, day and name, month and name, numeric, post name and custom structure.
We have discussed the default permalink, so now moving on to the other types. The date and name structure will include the date of publishing and the title of the post. In a month and name structure, the date will be removed and only the month, year and name of the post will be included. The numeric type consists of the number of the post. In the post name, only the title of the post will be mentioned and the last option is the custom structure where you can enter the permalink of your choice.
In order to change the permalinks, WordPress needs to modify your .htaccess file. Sometimes the WordPress may fail to make changes in the file which is why you need to change the codes manually. We have mentioned the process of changing the category prefix from the .htaccess which can help you in changing the permalink structure as well. There are certain tag structures which you need to add to the .htaccess file and save all the changes. Below we mention some of the most widely used tag structures to help you know better about the permalinks.
- %category% will specify the category of the post.
- %year% will indicate the year the article was posted.
- %postname% will mention the title of the post.
- %day% will mention the day the article was posted.
- %hour% will mention the hour the article was posted.
- %author% will mention the author name of the article.
- %post_id% will mention the unique ID of the post.
You need to be very careful while using the permalinks as they can directly affect the rankings of your website on the search engine result pages. For example, if you are going to use the %year% tag structure only, then your website will have multiple permalinks with the same structure which can make all of the posts inaccessible.
The best possible solution to that problem is making the permalink unique. Most of the people make the mistake of adding multiple tags to their permalink. This error not only increases the length of the URL but also decreases your website’s ranking. In order to make your URL unique, all you need to do is add either the post name tag or the unique ID tag. Though adding the post name is much effective as it includes the name and not just the numbers.
What Permalinks are the Best for WordPress?
Now have an idea of different types of permalink tag structures and what do they signify. There are many different structures, but not everyone holds the same position when it comes to effectiveness. Below we mention the best tags and why they are known be better than the rest.
#1 Post Name: Numerous website uses this structure is one of the most effective ones. The main reason for its popularity is that they are extremely easy to remember. All the user have to do is add the post name to the URL, and the page will be in front of their eyes.
#2 Day and Name: Most of the websites who post multiple posts on the same pages use the day and name structure. This helps those sites to add the date and the name of the published article in the URL.
#3 Category and Name: The process was all about changing the category prefix in your link. The reason to change the prefix was its significance in the rankings. By adding the category in your URL, you are letting your users know where exactly they are on your website. Moreover, these categories include most of the necessary keywords that you are going to integrate into your content. By adding the category name in your URL, you are adding the keywords in the URL as well which will ultimately boost your SEO rankings and help your website to grow.
This was the complete process of changing your category base prefix. Now you know different types of permalink structures and their importance on their website. We have also mentioned some of the best structures that you can use to enhance the rankings of your site on the search engine result pages.