How to Change Category in WordPress URL

30

You may have noticed that the WordPress CMS automatically includes the category prefix in the site’s URL slug.

Each category has its own archive page, so with this feature you can keep your content well-organized. Which makes visitors understand the structure of your web page.

In this article, we will show you how to change or remove category in WordPress URL.

Reasons to Remove Category from WordPress URL

The category prefix is part of the URL slug. You, as a website owner, definitely don’t want any extras like that, because they are not user friendly.

All you need to know about this URL slug is the part of the address that comes after the domain name. It serves to identify specific pages on your site.

URL slugs can tell search engines where to find a website page. In addition, visitors can also understand from the keywords about the page.

Usually this URL slug is generated automatically from the page title that you create, but you can also change it manually to make it more user friendly and good for SEO.

That is the reason for website owners to delete category urls in WordPress.

Example Category URL on WordPress Site

By default the original WordPress URL slug will look like this.

And after changing it will be.

The URL address in the example above looks more user friendly and still includes keywords that are important for SEO.

If your site is old enough, when changing the permalinks make sure you redirect the old URL to the new one. Otherwise, users coming from search engines and visiting category pages will experience errors.

By now you probably already know why you should delete category URLs on your WordPress site and what you should pay attention to.

Modify WordPress Category URL Prefix

Some website owners don’t mind long URLs, but they want to make them interesting.

So they prefer to change rather than delete it. Like turning it into ‘Article’, ‘News’, ‘Blog’, Genre’, ‘Tutorial’ or something else.

For example, if the default url is.

Become.

Here’s how to modify the category URL via the WordPress admin area.

1. First, all you have to do is login to the WordPress admin dashboard.

2. On the side menu, click Settings > Permalinks.

Open the permalink menu.

3. Scroll down on the ‘Category base’ section to enter a custom category. For example, here we will include Blog.

Enter category base

4. Then, don’t forget to click the Save Changes button to save the changes.

By modifying the permalinks, you can personalize the category prefix in WordPress URLs. But if you want to delete it instead of changing it, you can take a look at the following guide.

Remove Category in WordPress Permalink

Method 1: Via WordPress Admin Dashboard

Using this option you can get rid of the category slug completely by changing the site’s permalink settings via the admin area. Here’s the guide:

1. First, all you have to do is login to the WordPress site admin dashboard.

2. On the side menu, click Settings > Permalinks.

Open the permalink menu.

3. Enter the custom structure /%category%/%postname%/.

Enter the custom structure

4. On this page, scroll down to find the ‘Category Base’ section. After that, enter . (dot) in the column provided.

Enter the dot category base

4. Then, don’t forget to click the Save Changes button to save the changes.

Now, you can visit the website and open the category archive to see the results.

Method 2: By Adding Code in Functions.php File

In this second method, you can remove the WordPress URL category by adding a special code to the funchions.php file in your WordPress theme.

This method will not work if you have changed the basic category settings and replaced or removed the word ‘category’ from the URL slug.

Here’s the guide:

1. First, all you have to do is login to the WordPress site admin dashboard.

2. On the side menu, click Appearance > Theme Editor.

Open theme editor

3. In the right panel, find and click functions.php.

Find and click functions

4. Then enter the following code before closing the php tag on the bottom line.

Add the code at the bottom line

5. Don’t forget to click the Update File button to save the changes.

Method 3: Remove WordPress URL Category Using Yoast SEO Plugin

Yoast SEO is a search engine optimization plugin for WordPress that has many powerful features.

One of the features you can use is to delete category URLs in WordPress. If you’re already using the yoast plugin, this will be an easy way to customize the appearance of URLs on your site.

Follow these steps to remove WordPress category URLs.

1. First, all you have to do is login to the WordPress site admin dashboard.

2. On the side menu, click Yoast SEO > Search Appearance. Next, you should switch to the Taxonomies tab.

Go to Search Appearance in Yoast

3. Scroll down until you find Category URLs. In ‘Remove the categories prefix’ slide the toggle to Remove.

Remove URL category with Yoast

4. Then, don’t forget to click the Save Changes button to save the changes.

Method 4: Modify .htaccess to Remove Category URL WordPress

In addition to some of the options you can do above, removing category urls in WordPress can be done by adding code to the .htaccess file.

To open the .htaccess file, you can use an FTP client or cPanel hosting. Make sure your file manager is set to show hidden files. Here’s how:

1. Open the .htaccess file.

2. Add the following code at the bottom line.

3. Change according to your domain name, in the example.com section.

4. Then click Save Changes in the upper right corner.

Method 5: Using Remove Category URL Plugin

The next method you can try is to use the Remove Category URL plugin.

This plugin can completely remove the category prefix. Easy to use and does not require any configuration. This plugin can also redirect the old category permalinks to the new ones.

However, before using this plugin, I recommend trying some of the methods above. Because if you use too many plugins, it will affect site speed and will be bad for SEO.

If you decide to install this plugin, here are the steps:

1. First, all you have to do is login to the WordPress site admin dashboard.

2. On the side menu, click Plugins > Add New.

3. Type ‘Remove Category URL’ in the search box.

4. Click Install Now.

5. After that, click Activate.

Another plugin that you can use to remove WordPress URL categories is FV Top Level Categories. This plugin is very easy to use and will automatically redirect old urls to new ones.

Closing

If you want to remove the URL category slug in WordPress, you can choose one of the methods above.

As much as possible choose a method that does not use plugins, because it will not burden the server.

We hope you can follow the guide above smoothly, if you still have questions, please leave them in the comments column.

You might also like
Leave A Reply

Your email address will not be published.