WordPress.org

Ready to get started?Download WordPress

Forums

How to remove the "category" folder (48 posts)

  1. Honk
    Member
    Posted 9 years ago #

    Hi,
    I installed WordPress and everything works just fine except one thing:

    I chose the following permalink-structure:
    /%year%/%monthnum%/%day%/%postname%/

    Under the first Hello World post this shows up:
    Posted in Cooking | Edit | 1 Comment

    How can I remove the "category" folder:
    http://my-site.tld/blog/category/cooking/
    -->
    http://my-site.tld/blog/cooking/

  2. tomhanna
    Member
    Posted 9 years ago #

    That's an awfully odd domain name. Real links are always useful.

  3. Honk
    Member
    Posted 9 years ago #

    Sorry about that, but I haven't yet registered the domain. The website is just here on my local harddisc.

  4. /category is what's the default if you have something in the post permalink box and nothing in the category permalink box.

    And it seems you can't just put / in the category box. This is probably to stop conflicts with the post permalinks (makes sense).

    So hmm...

  5. 3stripe
    Member
    Posted 8 years ago #

    So, is there any way at all to remove 'category' from the permalink structure...?

    It's really messing up the look of my website :-(

  6. 3stripe
    Member
    Posted 8 years ago #

    I'm still stuck on this, can anyone advise if it's even possible :-?

  7. the-faun
    Member
    Posted 8 years ago #

    I'm trying to figure that out myself; I'll let you know if I do...

  8. bolonki
    Member
    Posted 8 years ago #

    I am also very keen to remove the /category/ in permalinks, it doesn't add anything of value but it does make the URL longer and that's bad for SEO reasons because they give higher ranking the closer the keyword is to the domain name...

    So nobody got rid of the /category/ thing in permalinks? I am sure someone did... come on, share your secrets! :)

  9. moshu
    Member
    Posted 8 years ago #

    There is no secret :)
    If you have something like:
    example.com/blog/mycategory/cooking WP will know to look for in the categories.
    If it would be "eliminated" as you ask:
    example.com/blog/cooking WP would look for a Page with the slug "cooking" and everything would break.

  10. bolonki
    Member
    Posted 8 years ago #

    So that's the reason why /category/ (or some other word of your choice) cannot be removed, right?

  11. moshu
    Member
    Posted 8 years ago #

    At least this is how I understand it ;)
    But, as it often happens, I might be wrong...

  12. 3stripe
    Member
    Posted 8 years ago #

    Seems a shame there's no way around this still.... it really does make the urls more complicated and less seo friendly than they need to be... plugin anyone???

  13. Chris_K
    Member
    Posted 8 years ago #

    You noticed that by visiting your Options -> Permalinks page you could change the word category to anything else, yes?

    The Optional section has a field for "Category Base:".

  14. 3stripe
    Member
    Posted 8 years ago #

    Yeah I got that bit! I guess it's just the fact that the category base is always there that niggles me.

    (It's not a biggie by any stretch of the imagination but I would still love to find away to avoid this)

  15. LiminalWP
    Member
    Posted 8 years ago #

    I also would dearly love to remove "category" from my permalinks. Does anyone know where in the WP code the permalink is generated? I'd be willing to take a stab at hacking a temporary solution.

  16. ladydelaluna
    Member
    Posted 8 years ago #

    "it really does make the urls more complicated and less seo friendly than they need to be"

    it really doesn't effect SEO much at all to be honest... search engines stopped considering URLs with such weight quite some time ago.

  17. 3stripe
    Member
    Posted 8 years ago #

    I like simplicity I guess - there must be a way to get around the extra segment in the url.... hmmm...

  18. LiminalWP
    Member
    Posted 8 years ago #

    I'm not sure if this is useful, but I just noticed that I'm only having this problem with my pages and not my posts. For example, the post with my gripe about this problem is found here:

    http://ongoingprocess.net/wordpress-woes/

    Note the lack of category, which would be "Geek".

    However, my Netflix widget page, which is filed under the sub-page "Projects", is found here:

    http://ongoingprocess.net/projects/netflixwidget/

    For this, the category is in there and I can't find a way to shake it.

    Perhaps there's some way to get WP to treat pages like posts for the purposes of permalink generation?

    (Running 2.0.2, btw)

  19. ladydelaluna
    Member
    Posted 8 years ago #

    "Perhaps there's some way to get WP to treat pages like posts for the purposes of permalink generation?"

    WP treats them like separate entities because they are - I'd be keen to bet that if it didn't do that, the site would malfunction somehow. I'm no PHP whiz by any means... but then again, I really don't see any reason to stress over URLs (with the exception of those default ones with the ? and all - they're ugly and ARE a teeny tiny itty bit less SE friendly - though it's still not enough to make me care).

    I have sites that use the ? and they are just as quickly and easily spidered as sites that use "pretty" URLs. Being in the SEO business for the past 5 years, I remember when it used to matter - truth really is, it doesn't anymore.

  20. LiminalWP
    Member
    Posted 8 years ago #

    "WP treats them like separate entities because they are - I'd be keen to bet that if it didn't do that, the site would malfunction somehow."

    Yes and no. Both pages and posts are all stored in wp_posts. The only difference between them from a storage perspective is post_status; pages get "static" and posts get "publish". Additionally, if a page is a sub-page then it gets a post_parent of the parent id (posts get "0"). So it's really up to the WP code how it decides to treat them.

    I would think a hack could be made to change this behavior without great difficulty, but I've not chased down the permalink code yet (most of my time is going to trying to finish graduating, 24 days to go!).

  21. andymike
    Member
    Posted 8 years ago #

    I would be interested in a solution to this as well. I would prefer to have my category permalinks organized just like posts:

    domainname.com/mycategory/

    instead of:

    domainname.com/category/mycategory/

    It just seems uneccessary the way they are now.

    Hopefully someone can figure it out.

  22. ladydelaluna
    Member
    Posted 8 years ago #

    it is necessary...

    as moshu stated above:

    "If you have something like:
    example.com/blog/mycategory/cooking WP will know to look for in the categories.
    If it would be "eliminated" as you ask:
    example.com/blog/cooking WP would look for a Page with the slug "cooking" and everything would break."

  23. moshu
    Member
    Posted 8 years ago #

    LiminalWP,
    in your post above you are confusing categories and parent-child Pages.

    When a single post is displayed the category name is NOT inserted in the permalinks - unless you specified so in your permalink structure setup.
    When displaying Pages there is NOT category inserted either - despite what you are stating. First of all, Pages do NOT have categories. Secondly, you example is about a child Page - in that case the permalink structure (rightly) is domain.com/parentpage/childpage

    And about why the word "category" (or any replacement of it) is needed... I tried to explain it at the very top and ladydelaluna just quoted it again above. (thx :)

  24. 8wheels
    Member
    Posted 8 years ago #

    Sorry to but in, but there's a disconnect here in understanding the problem I believe.

    The OP is referring to the word "category", not the catetory's name. When browsing by category, I get both - the word 'category' and the name of the category itself.

    http://busbuilding.com/category/energy/

    I *think* what he wants is to eliminate the word 'category', not the category's name.

    I'd like this too, but it's a nit...I have much more to worry about...like writing...;)

  25. moshu
    Member
    Posted 8 years ago #

    No, that's exactly what we are talking about: the WORD "category". You cannot eliminate it, but you can change it to whatever you want in the admin > Options > Permalinks > category base field.
    See it here how I changed it to something else:
    http://crosscultural.transycan.net/blog/

  26. ladydelaluna
    Member
    Posted 8 years ago #

    8wheels - no misunderstanding here... I think moshu and I completely understand what the OP is looking for, and we're trying to explain that it's sort of impossible.

  27. 8wheels
    Member
    Posted 8 years ago #

    Got it. I *knew* I shouldn't have butted in! :)

  28. LiminalWP
    Member
    Posted 8 years ago #

    Ah, I have been enlightened! I see that I (and I think perhaps one or two others) have been confusing two issues which sound similar when described. Based upon moshu's clarificiation, I would say that what I would like is the option to not have the parent page be part of the permalink for a child page. I shall move this notion somewhere else. Thanks for clearing this up for me!

    EDIT:
    I have posted the removing parent page from child page permalink topic here, for any who are interested.
    http://wordpress.org/support/topic/69755

  29. the_wellspring
    Member
    Posted 8 years ago #

    I don't understand why this happens, or if it's a supported function or a loophole of sorts, but if you type in '.' into the Category Base field it seems to solve the problem - but only in certain browsers.

    In Internet Explorer, the category links point to domain.com/./categoryname but in Firefox, Camino and Safari, links to categories go directly to domain.com/categoryname/.

    Is this what you were after?

  30. nateomedia
    Member
    Posted 8 years ago #

    The biggest frustration I've had with WordPress is the inability to remove the base category from the url permalink structure. The irony is that I'm very interested in using WordPress as a CMS, and its WordPress Pages -- a CMS "feature" -- that prevents the use of a logical permalink structure. Kill Pages and force me to create a category for static content any day over this mess.

    If one mixes categories with pages, one comes up with a really illogical url scheme:

    www.site.com/category/typing/
    www.site.com/about/
    www.site.com/category/forsale/
    www.site.com/intro/

    Huh?

    To make matters worse, depending on the browser (I've seen it work sometimes), going to www.site.com/category/ will result in a 404. Going to www.site.com/typing may or may not also result in a 404 (again, I've seen it work occasionally).

    It seems to me that there is a simple solution. Allow the user to turn off Pages. Without pages, there should be no need for the base category prefix. Those that like Pages can continue to use them, those that don't can ditch them.

    I actually tried to switch to Textpattern over this issue. But Textpattern is so backwards in so many other ways that it just wasn't worth the heartache. WordPress is great software, but I think removing Pages would make it 1000 times better.

Topic Closed

This topic has been closed to new replies.

About this Topic