Publisher Theme BetterStudio
English
  • العربية
  • فارسی
  • Publisher Theme
  • WP Plugins
  • Blog
    • Learn WordPress
    • Learn Marketing
    • Learn Design
    • Learn Shopify
    • Login
    • Create Account
Download Publisher
Publisher Theme <
  • Publisher WP Theme
    • Features
    • Demos
    • Showcases
    • Changelog
    • Support
    • Documentation
    • Publisher vs Others
      • Newspaper vs Publisher
      • Soledad vs Publisher
      • Jannah vs Publisher
      • Good News vs Publisher
      • JNews vs Publisher
      • MagPlus vs Publisher
      • Newsmag vs Publisher
      • SmartMag vs Publisher
      +
    +
  • Pricing
  • WP Plugins
  • Blog
  • Login
  • Create Account
Download Publisher
English
  • العربية
  • فارسی
Learn WordPress
  • All
  • WP Tutorials
  • WP Plugins
  • WP Themes
  • WP Hostings

How to Add Category and Subcategory to WordPress Permalinks?

A post’s URL should introduce the content of an article to users. A way to improve thi is to include category in WordPress permalinks.

September 18, 2019
0

WordPress has two options to categorize blog content: tags and categories. Categories are broad and can have subcategories. If you use them in WordPress, your users can easily find the content they are looking for.

In this article, we try to teach you how to include category in WordPress permalinks, as well as adding subcategories to them.

Table of Contents
Including Category to SEO Friendly URLs in WordPress
Adding Category and Subcategory in WordPress Post URLs
WordPress permalinks like /category/subcategory/post (Including category and child category in URL)
How to remove category from WordPress permalink
Remove categories from WordPress permalinks through setting
Remove categories from permalink using the .htaccess file
Remove categories from permalink using Yoast SEO
Remove categories from permalinks using a plugin
Conclusion

Including Category to SEO Friendly URLs in WordPress

The default structure of the WordPress permalinks doesn’t display categories and subcategories in a post URL.

If you use categories and subcategories in permalinks, you allow users to identify and locate their favorite content. In addition, if you have breadcrumbs activated in posts, using categories and subcategories are very beneficial.

Also, the post’s URL may include more keywords which will have a positive effect on the SEO.

Adding Category and Subcategory in WordPress Post URLs

First, log-in to WordPress dashboard. Then, go on Settings and Permalinks. In the general configuration, change the post URL structure and type in:

/%category%/%postname%/

Finally, save your changes.

Include Category in WordPress Permalinks

Keep in mind, if you don’t have any categories yet, once you save these changes, all of your posts will display the WordPress default category in their URL.

Therefore, create new categories and add your posts to the related category to avoid confusion.

WordPress permalinks like /category/subcategory/post (Including category and child category in URL)

To show WordPress permalinks as category/subcategory/post go to Settings > Permalinks.

Choose ‘Custom Structure‘ and add /%category%/%postname%/ to the field.

Now if you add one category and one subcategory, WordPress will show both of them in the permalink.

If there is more than one category or subcategory, WordPress will show the primary category or just show them based on alphabetical order.

How to remove category from WordPress permalink

If by default, categories are displayed in the URL, there a few ways to remove them.

Remove categories from WordPress permalinks through setting

Include Category in WordPress Permalinks

1. In the WordPress dashboard, go to Settings and then Permalinks.

2. Choose the structure and type:

/%category%/%postname%/

3. Add a dot in front of the paragraph and save the changes.

Make sure you follow these steps, otherwise, WordPress uses the default amount in this field. Check your website’s URL. Currently, this method is still viable but there are no guarantees that this work in the future.

Remove categories from permalink using the .htaccess file

By adding the code below to the .htaccess file, you can remove categories from WordPress permalinks.

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

Make sure you add the code before the </IfModule> tag in the .htaccess file.

Include Category in WordPress Permalinks

Remove categories from permalink using Yoast SEO

The latest Yoast SEO update disabled the ability to remove categories from permalinks. However, if you are not using the latest version, you may still use this plugin to remove categories from permalinks.

Some websites are still able to delete categories from WordPress permalinks with the latest version of Yoast SEO.

Keep in mind, if you have updated the plugin and cannot remove categories from the WordPress permalinks, you may have to install other plugins that are designed for this.

Remove categories from permalinks using a plugin

These plugins are very popular and useful. If your WordPress website is older than 6 months, you could use the Remove Category URL plugin.

These plugins work automatically and you don’t need to configure them nor edit a file.

Another recommended plugin is FV Top Level Categories. Writing code is also another way, although, it may affect the performance of your website.

Conclusion

In this article, we discussed how to include a category in WordPress and how to remove category from the WordPress permalinks. Categories in permalink can improve your website’s SEO, increase the coming traffic and sort your content.

Please Share This:

Leave a Reply Cancel reply

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

Publisher Theme

All-in-one WordPress Theme for Magazines, Newspapers and Blogs

WordPress Publisher Theme For Newspaper and magazine and blog Get Publisher
Content Protector

Prevent content copiers from copying your website texts, images, videos, and source code

Protect Your Content
  • Home
  • Blog
  • 📙 WordPress Tutorials
  • How to Add Category and Subcategory to WordPress Permalinks?
Get the Latest Tutorials by Subscribing to Our Newsletter
Subscribe to our newsletter to be notified on new post and product releases.
BetterStudio
  • Contact us
  • Advertise
  • Custom Development Services
  • Blog
Products
  • Publisher Theme
  • Better Ads Manager
  • Our Plugins
Useful Links
  • 30 Days Refund Guarantee
  • Refund Request Form
  • BetterStudio Affiliates
  • Affiliate Payout Request
Support
  • WPShield
  • Publisher Theme
Connect
  • Follow on Twitter
  • Join us on Facebook
  • Follow on Instagram
Copyright © 2025 — BetterStudio. Terms & Conditions — Privacy Policy