How to remove category names from WordPress URL slug

Remove Category WordPress URL

For the article: How to remove the Category name from the URL Slug of WordPress for website owners who use a CMS like WordPress. If you’re a beginner, if you look at the name of the URL Slug or the link of the content category, you will find that the Category name is included. To separate links or make it clear to us that the link is the name of a category.

For example, https://www.domainname.com/category/link-name/

But for website owners who want to make category links look shorter and don’t want the word category as a component of category links to be displayed. We can delete it in a variety of ways as follows.

Method 1: Delete a category by setting it in the Permalinks section of WordPress.

remove category wordpress url 02

  • Log in to the WordPress dashboard.
  • Go to Settings -> Permalinks.
  • Select the topic Custom Structure and type %category%/%postname%/ into the text box.
  • In the Category base heading, enter a period ( . ) and press Save Changes.

After this, try going back and exploring our website. You’ll notice that category URL links no longer include the word category as an element.

Method 2: Removing categories from WordPress URLs with a plugin.

remove category wordpress url 03

This plugin is Remove Category URL when we install the plugin and activate the plugin. After that, there is no need to adjust any settings in the plugin. And the topic or category will automatically disappear from our URL link. The Remove Categofy URL plugin is also compatible with WPML plugins or language switching plugins.

Method 3: Delete categories from WordPress URLs using the Yoast SEO plugin.

I believe that there are quite a few websites that need to install the Yoast SEO plugin, a tool for easily getting your website ranked on Google.

remove category wordpress url 04

When the Yoast SEO plugin is installed and activated or the Yoast SEO plugin has already been installed. Then go to the Yoast SEO menu -> select the Settings topic.

At the Categories & tags heading -> select Category and move the mouse down to the bottom.

remove category wordpress url 05

By default, the heading Show the categories prefix in the slug is enabled. Here you can disable /category/. When you return to the home page of your site and look at the URL location of your WordPress link, you will notice that the previously displayed categories are gone.

Method 4: Deleting the category name from the URL with the .htaccess file.

The .htaccess file will be stored in the main directory of the WordPress system files. This method may not be suitable for new website owners. Because if you edit the file incorrectly That will mean your website will stop working immediately. But if you are confident that nothing will go wrong, then read the steps in this topic carefully.

By copying this line into the .htaccess file (How to access and open this file to edit the file This must be done through an FTP program or WordPress file editor only.)

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

By changing the name www.yourdomain.com is the name of your website Then save the file It’s finished.

Note.

For the option to remove category from WordPress URL links, all 4 methods I have mentioned above. Of course, I would like to recommend method 2, which is the most suitable and the most convenient method for seasoned or new website owners. However, if your WordPress website already has a large number of plugins installed, the second method may not be very appropriate. Because the more plugins installed on your website, the more Your website will also take more time to load pages.

Leave a Reply

Your email address will not be published. Required fields are marked *