5

Is it good for SEO to include the category in the URL? Like so:

/articles/ID/example_category/slug

Or does it not matter and only make the URL unnecessary long?

Note; the article is also available at /articles/ID which redirects to the URL above, so the user does not have to type out the long URL.

0

3 Answers 3

2

It's helpful for SEO. Besides getting a keyword in your URL, which is a ranking factor, it helps to categorize and organize your content which is also good for SEO.

2

Overall, URLs are a very small signal for SEO. You have the potential to have good SEO regardless of whether or not you put the category into the URL. There are many possible good URL structures for any site. The most important things are that:

  • The URLs don't change often
  • If URLs do change, you redirect from the old to the new
  • Each piece of content has a single preferred URL
  • If multiple URLs can get to the same content, you mark the preferred one as canonical either with redirects or tags.

I prefer simpler URLs for SEO that don't have the category. The ideal URL would be:

/slug

and my second choice would be:

/ID/slug

You should include the ID, only if your content management system needs it to look up the article by id, rather than by name.

Ideally, the slug should:

  • Uniquely identify the content on your site
  • Adequately describe what the post is about
  • Contain the main keywords
  • Make sense to a human
  • Use as few words as possible
  • Be all lower-case
  • Be short and simple enough it could be typed
  • Be short and simple enough it could be memorable

If your article were titled "How many blue widgets to choose for a fishing trip," I might make the slug be just /fishing-widgets (assuming this is the only article related to fishing and widgets on your site.)

I would avoid putting the category (widgets) in to that URL because:

  • It often duplicates keywords from the slug
  • It allows you to re-categorize your articles without changing URLs and having to implement redirects
  • It uses less punctuation in the URL, which makes it more user-friendly
  • It keeps the URL shorter, which makes it more user-friendly

I prefer to use categories for organization within the HTML of the pages, but not in the URL. It is a great idea to organize content into categories and have a page for each category. You can have breadcrumbs on the page that show the category. You can link each post to related categories and other posts in the same category.

Using categories on your site but not in your URLs keeps your site well organized while keeping the URLs simple, friendly, and optimized for SEO.

2

Basically I agree – for search engine optimization it can be very useful to have a machine (and human) readable category name in your url. As John Conde points out it also helps you, your visitors and search bots to categorize your content.

But I would strongly recommend to have a hierachical url structure – which does not seem to be the case in your example.

And maybe you could also leave the "articles" out or find a better content related title for that directory like "gadget-news/" or "concert-reviews/" or whatever suits your content best.

So instead of

/articles/ID/example_category/slug

use something like this:

/main-category/sub-category/slug

or if you/ your cms needs the article ID you could just append it to the slug

/main-category/sub-category/slug-ID

This way your url structure would also be quite similar to a corresponding breadcrumb – which could also come handy at some point.

ps: If you just have one main category that's fine – I just used that term instead of "subject" or "theme" because it suits the idea of ordering content in a hierarchical structure.

1
  • 1
    The reason I start with articles is because I have several other resources, such as projects, applications etc, which may have the same category as other resources. But uses other back-ends altogether. The reason I have the ID field is because I want the category and slug to be able to change without breaking the link, so they are not actually used for look-ups. If they do not not match the article the user is simply forwarded to the correct URL with a 301 redirect. I've taken this principle from StackOverflow. Sep 10, 2014 at 13:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.