WordPress remove category from url

New Page

WPMarmite WPMarmite

  • Blog
  • about
  • Guides
  • Resources
  • Contact
  • Informative newsletter
  • search this site


  • Blog
  • about
  • Guides
  • Resources
  • Contact
  • Informative newsletter
  • search this site

Home » WordPress Blog » WordPress Tutorials » How to Change Category and Tag URLs in WordPress

How to change the URL of categories and tags in WordPress

Published by WPMarmite Team on October 2, 2020 • Read in French


  • Home
  • conception web
  • WordPress
  • us envelopes
  • Acheter BeTheme

parallax background

Exit category from WordPress URL

Albert Ślusarczyk


Tips, tricks and everything you need to know about BeTheme


You’ve probably noticed that WordPress automatically includes the category prefix in your site’s URL slug. Each category has its own archive page, so this feature keeps the content well organized.

Habituellement, le préfixe n’a pas besoin d’être supprimé. Il aide les visiteurs à comprendre la structure de votre page.

However, sometimes it can be beneficial to remove a category from a WordPress URL. This article explores some valid reasons for taking the prefix out. You’ll also learn how to do it.

Reasons to Remove Category From WordPress URL



The category prefix is part of the URL slug. As any SEO-conscious website developer or owner, your goal is to optimize this feature.

What exactly does URL slug refer to? It is the part of your address that comes right after the domain name. It identifies the resource, a specific page on your site. The slug tells search engines where to find your web page. Moreover, visitors can understand from the keywords what the page is about.

Slugs are usually generated by default from a page title, but they can be changed manually. Ideally, a clean SEO-friendly URL contains only meaningful and relevant keywords. They should be intuitive and easy to understand by both search engines and visitors. However, that’s not the only relevant thing when it comes to the SEO of your website, as the speed of the website, UX and the importance of good link building is also necessary.

That’s the reason why some developers may decide to remove the category prefix from the URL.

Let’s have a look at an example of what it could look like if you remove a category from a WordPress URL:

If the original slug was ‘yoursite.com/category/best-seo-practices’, the modified slug would be ‘yoursite.com/best-seo-practices’.

The link in the example above now looks cleaner while it still includes the keywords which are important for SEO. A visitor who found your page using a search engine will also directly see the content he was looking for.

If you modify the permalinks of your site, make sure you redirect old URLs to your new ones. Otherwise, users visiting the old category page will run into an error.

So far, we’ve explained why you may decide to remove categories and what you should be careful about.

Here are some tips on how to take the prefix out of the URL slug.

Modifying Category Base Prefix



Some developers don’t mind the length of the URL slug, but they want to personalize it.

In such a case, you can change the Category base. Instead of ‘Category’, you can customize the prefix to ‘Articles’, ‘Topics’, ‘Blog’, ‘Genre’, ‘Tutorials’, or similar.

To demonstrate what the edited slug will look like, we can use the same example mentioned earlier.

If the original slug was ‘yoursite.com/category/best-seo-practices’, the new URL could be ‘yoursite.com/articles/best-seo-practices’.

You can modify the category base prefix if you go to the Settings in your WordPress admin.

  • Go to your admin dashboard.
  • Go to Settings >> Permalinks >> Optional >> Category base.
  • Enter your customized category base (e.g. ‘Articles’)
  • Save the changes.

By making this modification, you can personalize the category prefix in your WordPress URL. But you may decide to completely remove it.

Remove Category in WordPress Permalinks



This is an option that allows you to take out the Category prefix completely by modifying your site’s permanent link settings.

Here is the process described step by step:

  • Connect to your WordPress dashboard.
  • Go to Settings >> Permalinks.
  • Go to Custom Structure and put ‘/%category%/%postname%/’.
  • Go to Category Base and type in a dot “. “.
  • Save the changes.

The category prefix was removed by typing the dot in the Category Base field. If the field is left blank, WordPress will use the default prefix.

Removing Category by Adding a Code in functions.php File



Another way to remove a category from a WordPress URL is by typing in a code in functions.php.

This option will not work if you have already modified the category base settings and replaced or removed the word ‘category’ from your URL slug.

In order to add the code, follow this process:

  • Go to your WordPress dashboard.
  • Select Appearance >> Theme Editor.
  • Find ‘functions.php’.
  • Type the following code before the last PHP tag:
  • function remove_category( $string, $type ) { if ( $type != ‘single’ && $type == ‘category’ && ( strpos( $string, ‘category’ ) !== false ) ) { $url_without_category = str_replace( “/category/”, “/”, $string ); return trailingslashit( $url_without_category ); } return $string; } add_filter( ‘user_trailingslashit’, ‘remove_category’, 100, 2);

Using Yoast’s SEO Plugin to Remove Category from WordPress URL



Yoast SEO is a search engine optimization plug-in for WordPress. It comes with many useful features.

One of the many functions it offers is the possibility to help you remove the category prefix. So if you’re already using this plugin, this may be another easy way to customize your URL look, without adding or changing any code.

Before you use this procedure, make sure that you haven’t modified the Category Base settings in permalinks.

Follow the steps below to take the category prefix out:

  • Go to your WordPress dashboard.
  • Select Yoast SEO >> Search Appearance>> Taxonomies
  • Go to Category URLs and select ‘Remove the categories prefix’.
  • Save the changes.

Modifying .htaccess to Remove Category From WordPress URL

I’m interrupting the article to tell you about BeTheme, the definitive multipurpose theme. If trying to satisfy multiple clients has become more stressful than rewarding, BeTheme has a solution for that.


BeTheme’s selection of hundreds of customizable, responsive pre-built websites is the highlight and a proven stress reducer.

The customizability of the theme makes it a dream come true for its users. There are 4 types of Page Builders that you can use with it: WPBakery, BeBuilder, and Elementor among them.

And now with the Live Builder, it’s even more impressive.

Check out BeTheme and see why our users love it!

The rest of the article is down below.


Besides using a plugin or any of the other options mentioned earlier, you can also remove the category prefix by adding a code to your .htaccess file.

You can access the file either via FTP or cPanel. If you can’t find the .htaccess file, check if your file manager is set up to show hidden files (dotfiles).

Here are the instructions:

  • Go to your .htaccess file.
  • Add the following code after the closing tag in the file:
  • RewriteRule ^category/(.+)$ http://www.site.com/$1 [R=301,L]

  • Write your domain name in place of www.site.com in the code above.
  • Upload it on your server’s public_html directory.

Using the Remove Category URL Plugin



The next option you have when trying to modify your URL slug is the Remove Category URL plugin.

This plugin completely removes the category prefix. It’s easy to use and doesn’t require any configuration. It also redirects old category permalinks to the new ones.

However, before installing more plugins, try another method first. Some plugins can negatively affect the loading speed of your site.

If you decide to install this tool, these are the steps:

  • Go to your WordPress dashboard.
  • Select Plugins >> Add new
  • Type ‘Remove Category URL’ in the ‘Search plugins’ box.
  • Click on ‘Install now’.
  • After it has been installed, click on ‘Activate’.



Another plugin that can assist you with removing the category prefix is FV Top Level Categories. It is simple to use and light on code. It automatically redirects old category permalinks to the new ones.

Ending thoughts on how to remove category from WordPress URL

Each time you create a new category in WordPress, an archive page for that category is automatically generated. The ‘category’ prefix is by default included in the URL slug.

Although categories add some structure to your content, there are some good reasons to remove the category base.

Trimming the unnecessary wordiness while keeping the important keywords in the URL slug can help the site’s SEO.

It also improves the readability of the link and makes it easier for visitors to identify the content they are looking for.

There are a few effective ways to remove categories. Changing the permalinks is one option.

Plugins can do the job too. If you’re already using the Yoast SEO plugin, you can benefit from its many useful features, including the option to remove categories.

There are other plugins too, such as those suggested in this article.

If you feel confident adding a code, you can remove the category prefix in the .htaccess or functions.php file.

Any of the above-mentioned methods will help you achieve the desired customized and SEO friendly look of your URL slug. These steps have been tried and are safe to use.

If you enjoyed reading this article on how to remove category from WordPress URL, you should check out this one about fixing the destination folder already exists.

We also wrote about a few related subjects like WordPress posting to Facebook, how to reorder pages in WordPress, fix the could not save password reset key to database, failed to load resource, fixing the another update is currently in progress, how to revert WordPress to previous version and how to add a button in WordPress.

Albert Ślusarczyk Albert Ślusarczyk

Albert Ślusarczyk

As the co-creator of Be Theme, I strongly believe in designing with care and patience. I dedicate my energy, time, and knowledge to perfecting the theme for our 230,000+ customers.

Similar Items

elme-temp-960x658 svg%3E

January 25, 2022

Elementor vs. Beaver Builder vs. BeBuilder: which is better?

Read more build-960x695 svg%3E

January 25, 2022

Elementor vs wpBakery vs BeBuilder: Which one you should use

Read more muffin-cus-960x731 svg%3E

January 25, 2022

Best Elementor Alternatives You Should Try

Read more

We would like to thank you for helping us to make our products better and better

See BeTheme in action

© The BeTheme blog. All rights reserved. muffin group

logo_footer svg%3E

Home » Blog » How to remove a category from your URLs in WordPress


How to remove a category from your URLs in WordPress

Estaba tratando de averiguar cómo eliminar /categoría/ de las URL de mi categoría y simplemente no pude eliminarlo. Por ejemplo, jonnyjordan.com/category/blog Solo quería ser jonnyjordan.com/blog, pero descubrí un truco rápido para lograrlo.

Para deshacerse de la categoría, configure sus enlaces permanentes en /%category%/%postname%/ y luego configure la base de categoría en punto/punto.

*Si deja en blanco la base de categorías, se mostrará la categoría predeterminada de wordpress.*

  1. Vaya a Configuración > Enlaces permanentes
  2. Seleccionar estructura personalizada
  3. Agregue /%category%/%postname%/ después de su dominio
  4. Cambie Base de categoría a punto/punto.

How to remove the category from your URL in WordPress

Eliminar categoría de sus URL con el complemento SEO de Yoast

Another quick way to remove a category from your URLs is to use the Yoast SEO plugin. Yoast comes with a handy setting to remove the category base for you.

  1. Go to Yoast SEO
  2. Select advanced
  3. Click the permalinks tab at the top
  4. Check Remove category base (usually /category/) from category URL.

remove category from url addon

Remove a category from your URLs with .htaccess

To manually remove the category base in the .htaccess file, just add this line of code.

Rewrite rule ^category/(.+)$ http://www.site.com/$1 [R=301,L]

Remove category base with Remove Category URL plugin

This plugin also removes the category base and also seems to be quite popular. I would recommend this method the least because too many plugins will slow down your website and force you to keep more plugins up to date. https://wordpress.org/plugins/remove-category-url/

remove plugin from category


All four of the above methods will work to remove the category slug from your URLs. Although I would recommend choosing the method that is going to use less code in your case.

Keywords: google, google-analytics, tutorial

Please share if you find this useful

  • Facebook
  • burning
  • Linkedin
  • google+

Google Google translator

Google Google Translate

Video WordPress remove category from url

Related Posts

Free chat room code for my website

Contents1 How to set up a free chat room on the website.2 3 comentarios2.1 Trackbacks/Pingbacks2.2 Submit a Comment Cancel reply3 How to Create a Chat Room Website…

Background image full screen css

Contents1 Cómo – Full Page Image1.1 Example1.2 Example2 CSS background image tamaño tutorial: how to codify a complete page background image3 Perfect Full Page Background Image3.1 Méthode CSS géniale,…

WordPress leverage browser caching

Contents1 Aproveche el almacenamiento in hidden del navegador1.1 Will it works for my website?1.2 Where are plugin options1.3 Some JavaScript files still display under Leverage Browser Caching1.4…

WordPress post to facebook page

Contents1 How to Automatically Post to Facebook from WordPress1.1 Download Now: How to Launch a WordPress Website [Free Guide + Checklist]1.2 1. Create an IFTTT account.1.3 2….

Download images from wordpress media library

Contents1 How to export your WordPress media library1.1 Download maintenant : How to launch a WordPress website [Free Guide + Checklist]1.2 How to export your WordPress media…

WordPress single post template

Contents1 How to Create Custom Unique Post Templates in WordPress2 Post Template Files2.1 author.php2.2 Fecha.php3 Handbook navigation4 How to Create Custom Single Post Templates in WordPress5 Video…