How to Include Category and Subcategory in WordPress URLs

Recently one of our readers asked us how
to include category and subcategory in
WordPress URLs. Categories and
subcategories allow you to sort content on
your website. They also allow your users
to easily browse the topics they are most interested in. In this article, we will show
you how to include category and
subcategory in WordPress URLs.

Including Category to SEO Friendly
URLs in WordPress

WordPress comes with two built-in taxonomies to sort your content. They are called categories and tags.

Categories are typically used for more
broader topics and can have subcategories.

However, if you are using the default WordPress URL structure , then your categories and subcategories are not
included in the post URLs.

Some websites use categories and
subcategories in WordPress URLs for their
posts. For example, at WPBeginner we
include category in the URLs of our posts
like this:

http:// http://www.wpbeginner.com/plugins/7-best-wordpress-backup-plugins-compared-pros-and-cons/

Some websites that use subcategories
display both parent and child categories in
the URL.

http://example.com/news/national/article-title-here/

In this example, news is the parent
category and national is the child category.

Including category or subcategory to your
post URLs makes them more user-friendly.
It matches the breadcrumb navigation on your site and it includes more keywords
and text which is also helpful for SEO.

Having said that, let’s see how to easily
add category and subcategory in
WordPress URLs.

Adding Category and Subcategory in
WordPress Post URLs

First, you need to visit Settings » Permalinks page in your WrodPress admin. There you need to click on the
‘custom structure’ option under
common settings area.

Next, you need to add /%c a t e g o r y %/%p o s t n ame%/ in the field next to custom structure.

After that, don’t forget to click on the
save changes button to store your settings.

That’s all WordPress will now start
including category and subcategory in
WordPress URLs. You can see this in action
by editing a post or creating a new one.

File that post under a category (and
subcategory if you use them) and click on
the update button.

You will notice category and subcategory
included in the post’s permalinks.

Using Multiple Categories or
Subcategories

Let’s suppose you file your blog posts
into multiple categories or subcategories.
WordPress will only include one category
and one subcategory in the URL. If you
didn’t choose a subcategory, then it will
only show one parent category.

WordPress chooses the category
alphabetically. For example, if you file a
post in Apple and Technology categories,
then WordPress will include apple in the
URL because it comes first in alphabetical
order.

h t t p : / / e x amp l e . c om/ a p p l e / a r t i c l e – t i t l e – h e r e /

If you file a post in ‘Apple’ and a
subcategory under that called
‘Technology’, then it will include both of
them in the URL.

h t t p : / / e x amp l e . c om/ a p p l e / t e c h n o l o g y / a r t i c l e – t i t l e – h e r e /

If you selected a subcategory but didn’t
specifically select parent category, then
WordPress will still include parent
category in the URL.

Another scenario is when you have a
parent category, subcategory, and a sub-
subcategory. WordPress will include all
three of them in the URL.

h t t p : / / e x amp l e . c om/ a p p l e / t e c h n o l o g y / e v e n t s / a r t i c l e – t i t l e – h e r e /

We hope this article helped you learn how
to include category and subcategory in
WordPress URLs.

Advertisements

9 thoughts on “How to Include Category and Subcategory in WordPress URLs”

  1. You actually make it seem really easy with your presentation but I to find this matter to be actually one thing which I believe I would never understand. It kind of feels too complex and very huge for me. I’m taking a look forward on your subsequent submit, I’ll attempt to get the cling of it!

    Like

  2. You actually make it appear so easy together with your presentation however I in finding this matter to be actually one thing that I feel I would never understand. It sort of feels too complicated and extremely extensive for me. I’m taking a look forward to your subsequent put up, I’ll attempt to get the cling of it!

    Like

  3. Nice weblog right here! Also your site loads up fast! What web host are you the usage of? Can I am getting your affiliate hyperlink in your host? I want my site loaded up as fast as yours lol

    Like

  4. Wow, wonderful blog format! How long have you been running a blog for? you made running a blog glance easy. The whole glance of your website is great, as neatly as the content!

    Like

  5. Excellent blog right here! Additionally your website a lot up fast! What host are you the usage of? Can I am getting your affiliate hyperlink to your host? I wish my website loaded up as quickly as yours lol

    Like

  6. Excellent blog here! Also your web site loads up very fast! What web host are you using? Can I am getting your affiliate hyperlink to your host? I wish my web site loaded up as fast as yours lol

    Like

  7. I take pleasure in, cause I discovered exactly what I was looking for. You have ended my 4 day lengthy hunt! God Bless you man. Have a nice day. Bye

    Like

  8. I do accept as true with all of the ideas you have offered on your post. They’re really convincing and will certainly work. Still, the posts are too quick for starters. May you please prolong them a little from subsequent time? Thank you for the post.

    Like

  9. You can definitely see your skills within the work you write. The arena hopes for more passionate writers such as you who aren’t afraid to say how they believe. Always go after your heart.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s