The MU forums have moved to WordPress.org

[closed] Remove "category" in URL!! (20 posts)

  1. thelaw
    Member
    Posted 15 years ago #

    I've been unable to remove the "category" slug from urls.

    I applied a hack to do a string replace for category appearing but it only works for main categories, not subcategories.

    http://www.mysite.com/blog/sports/

    That looks fine, but if you look at a link on the same page for subcategories, there is that damn slug again and it screws up the url.

    http://www.mysite.com/blog/category/sports/baseball/

    I don't even know why the word "category" should even appear in a URL in the first instance. Has anyone ever been able to remove this permanently?

  2. lunabyte
    Member
    Posted 15 years ago #

    WordPress has been that way for quite a long time.

    There are plenty of plugins out there, and forum topics as well, which cover this.

  3. thelaw
    Member
    Posted 15 years ago #

    Thanks for the very useful post. Have you ever tried to use the useless plugins search in the "extend" area? Unfortunately Wordpress has to be the least efficient site to find essential information I've ever seen and I say that with much chagrin. I switched from Joomla thinking it would be easier, only to find so many essentials are plugins that are strewn all over the place, each which may only partially work.

    I've used Google and haven't found one solid answer that works to remove the "category" slug in all respects. Parent works, subcategories do not work. Numerous requests appear for answers, no complete answers given, requests made from many years ago as well. Maybe, instead of posting RTFM where there isn't a FM, you could do us the honors of posting just one or two references to a solution. I'm sure plenty of people here would appreciate it.

  4. lunabyte
    Member
    Posted 15 years ago #

    Guess you need to spend a little more time with Google then.

  5. thelaw
    Member
    Posted 15 years ago #

    Lunabyte... you're an obnoxious, worthless pest.

  6. lunabyte
    Member
    Posted 15 years ago #

    Really, you don't want to start this. Even though you already did with the RTFM comment when I simply pointed out that it was something that had been in existence for a long time, and that there was a lot of existing documentation, plugins and discussion.

    Just because you don't like an answer, and it doesn't spoon feed your needs doesn't mean you have to be a jerk about it. I'm sorry if your googling skills are poor, but that is far from anything anyone here can help you with.

    So, before you decide to be a prick to someone offering up advice, think twice as you're going to end up annoying those who can and would normally assist.

    If you would like to continue your little game, feel free. Have a great time. Just remember how you are creating a perception of yourself, and further alienating those of us (who know the software like the back of our hands) who have the knowledge to help you.

    So, if you would like further information, and I'm surprised there hasn't been another post mentioning it, it's actually a part of the WordPress core, and should be directed to their forums in order to maintain continuity.

  7. thelaw
    Member
    Posted 15 years ago #

    FYI Lunabyte, my Googling skills are just fine. What advice are you offering up now - that there's been whole a lot of discussion on this??? I'm trying to restrain myself... There are a gargantuan number of incorrect and incomplete "solutions" on this topic to sift through and these forums and Wordpress site don't make it easy either. Perceptions? I've done my homework and at least I'll post and share what I find that is wrong. But what are you offering? A condescending reminder that you're a "bastion in the community" and we should revere and respect the "authoritay" of those holy ones who "know the software like the back of our hands." So here you go:

    (1) Simply removing the %category% tag from your permalink obviously doesn't work. If you display subcategories the word "category" appears.

    (2) I've tried the suggestion to use string replace in the category-template.php. Like the hundred indexed pages that cite this hack, there are the comments that report "doesn't work when subcategories are displayed" and that is correct amongst other issues. I haven't found any answers for this one.

    For those searching, here's the line to add between the two $catlink lines in the get_category_link function:

    $catlink = str_replace('%category%', '', $catlink);

    This link is the most popular:

    http://socialcmsbuzz.com/remove-the-word-category-from-wordpress-urls-18082008/

    (3) The "remove parents" plugin removes too much or too little in my installation of WPMU 3.7. It removes the entire URL after the blog portion when displaying subcategories and too little when displaying posts (it only removes one level of categories.)

    I'm no jerk or kid who is asking for spoonfeeding. Perhaps you should show a little humility too - I'm not here to tick anyone off and have been a long time contributor to numerous open source projects. Quite frankly, one huge problem with WP is that while it is extensible, it has been made too extensible. There are too many popular needs that aren't addressed properly or in an organized fashion and with too many half baked plugins in a repository that don't work. As much as Joomla was a resource hog and can give one grief as you extend your site, at least those guys had it together when it came to more easily finding extensions and having an official list of a good number of solutions in their extended FAQs.

  8. thelaw
    Member
    Posted 15 years ago #

    At least one of us is trying to help:

    (4) Top Level Categories Plugin - will not work in removing categories if you have a permalink that does not use an extension, e.g. .htm or .html

    "This is a known issue, for which there is unfortunately no good workaround. If you add a suffix to your permalink structure (such as .html) you can fix this issue. For example, try %category%/%postname%.html -- I realize this is not ideal, but there is no good solution for this issue."

    So.... do these people that know Wordpress like the back of their hands have any answers? This is a pretty huge flaw and I'm surprised that it isn't fixed "in the core" to appear appropriately.

  9. thelaw
    Member
    Posted 15 years ago #

    (5) Besides 2 other plugins (such as http://www.brianshoff.com/wordpress/category-base-removal-plugin.htm),

    (6) "Pathless Category Links" doesn't work either completely:

    http://wordpress.org/extend/plugins/pathless-category-links/

    This one DOES get rid of the word "category" - but there is a problem with subcategories. Links on a page mysite.com/categoryname/subcategoryname/ do NOT show articles listed in that subcategory. The link to the subcategory using this plugin that works is mysite.com/subcategoryname/ and not the former. Deactivating the plugin, mysite.com/category/categoryname/subcatgoryname/ DOES show the articles in that subcategory.

    SO this plugin is toast too. So that brings us back to your comments, Lunabyte. What "spoon feeding" is going on? What was the need to tell me "RTFM" twice and then rip me a new one? The homework has been done, literally at least 6-8 hours wasted on trying to figure out something that shouldn't have been a problem in the first place. Now hopefully you can contribute something productive and maybe show some humility and admit that perhaps you jumped the gun on this rather obvious and significant Wordpress problem? If you know Wordpress like the back of your hand... please... share this information with the rest of the community in a helpful manner instead of using the back of your hand to slap my respectful face.

  10. duane_steel
    Member
    Posted 15 years ago #

    Hey theLaw, I went through all the same craziness as you did and Lunabyte clearly doesn't have the experience to know that this has been a common and much-discussed problem, without many complete solutions. Much googling leads to people saying they've found solutions that don't cover all cases, so I certainly understand your pain.

    Anyways, the best solution I've found is using the redirection plugin and the decategorizer plugin together (both are available from 'extend') subcategories, pages, etc all seem to work just fine (so far) but i've only been using it a few days.

    important to note, I'm using WPMU 2.7

    good luck!

    Lunabyte.. seek help..

  11. thelaw
    Member
    Posted 15 years ago #

    Duane - Thanks so much for your response! Could you tell me what your permalink setting is for your blog? I tried mine with /%postname%/ and that didn't work, nor did /%category%/%postname%/ and wonder if maybe the latter worked for you or another variation. Again, many thanks and hopefully we'll lick this important, critical Wordpress flaw when using subcategories.

  12. thelaw
    Member
    Posted 15 years ago #

    Looks like Lunabyte doesn't have an answer except RTFM because there is no solution according to many more posts that I've read. You simple cannot remove the word "category" from appearing somewhere in your URL with any plugin or hack currently being provided. I used the suggestion of removing %category% entirely and it works for the most part, except when subcategories are being built and then it creates the preposterous URL to the subcategory of:

    mysite.com/%blogname%/category/%maincategory%/%subcategory%/

    It's hard to believe that of all the years in its existence, that someone who "knows the core" so well wouldn't have fixed this obvious, ugly problem. Why I moved to Wordpress from Joomla is beyond me. It seemed simple enough for users to use and not to worry about URLs not working. So let's hope the people who "know the core like the back of their hand" will give us more insight as it's not going to get any better by doing more Google searches. I hope I've saved some of you a lot of time and grief instead of you being provided with BS.

  13. tdjcbe
    Member
    Posted 15 years ago #

    Dude, would you please take the stick out of your ass?

    From your first post, all you've done is insult those here trying to help people. Maybe that's why no one wants to help you.

  14. lunabyte
    Member
    Posted 15 years ago #

    Also, it appears you're hear just to bash people and WP. Have a nice time.

    It works just fine on several of the sites I maintain, so it would appear your attitude has kept you from the solution. Sorry about your bad luck, Chuck.

  15. tanvir
    Member
    Posted 15 years ago #

    #thelaw: so far the best solution for your issue is redirect url.

    Now one of the base feature of WP is integrated link management; a search engine-friendly, clean permalink structure.

    To maintain a structure you have to follow a certain rules. that's where the answer of your problem.

    Now, as from your previous post it seems you came from joomla background. The fact you can't compare Joomla & wordpress. Joomla's primary focus is content management where WP's is templating system for bloggers, so that they can maintain the site using Plug-in & widget without any hand on PHP or HTML.

    As you mentioned earlier that, you contribute to many open source project but i think either you forget or you don't know the principals of open source.

    You are getting most of the things around here without paying any. So, don't you they deserve a minimal respect for these.

  16. thelaw
    Member
    Posted 15 years ago #

    I came here with a question. The answer I got from Lunabyte was "there's lots of answers" - who just felt like telling me "I KNOW the answer but I'm not giving it to you so go use Google." His follow up about not wanting to spoonfeed is insulting. Then you've got his buddy tdjcbe jumping on his bandwagon. Just because you contribute to an open source project doesn't give you the right to act like a condescending jerk. Nor does my being here mean that I should have to take it.

    Tanvir - I'm expecting the common courtesy you'd show your neighbor's cat. If these know-it-all contributors don't know an answer, then say it or say nothing at all. Don't barge in on my thread, tell me to do better Google searches and force me to waste hours and days of time solving a problem that isn't solved or can't be solved easily.

    BACK TO THE WORDPRESS PERMALINK ISSUE:

    The problem with the permalink structure in WP is that there is the word "category" embedded within the URL structure and cannot be removed. What is frustrating is that I moved to Wordpress thinking, as its fans rave, "it does the basics like blogging very, very well." And in some areas it does but this one puts a lot of tarnish on what is otherwise a good product. I moved to Wordpress for the simplicity over Joomla and didn't expect to have to deal with plugins, hacks and other workarounds for items as simple as URLs/permalinks and simple pagination. I've found out that even the simple commenting pages create duplicate URLs.

    What they did well with Joomla was have a team that listed these problems. They admitted them. Then there were people who worked together to solve them. Instead I got some smart talk from those "in the know" when it would have just been easier to admit that permalinks are challenges with Wordpress. Time would be better spend putting together a FAQ of these items and listing the current status instead of sending us on more time wasting wild goose chases.

    The bottom line is that you must have the word "category" in your URL if you use subcategories unless you plan on doing some serious hacking to your install.

  17. lunabyte
    Member
    Posted 15 years ago #

    Bottom line:

    80,000 posts about the same topic accomplish nothing. If you didn't like the response, a simple "thanks, but I did search thoroughly and the results were [insert description]".

    Instead, you went off on a tangent, so that's what you're getting back. Don't like it? Don't start flapping your gums and spattering useless attacks on someone offering up a contribution to the topic.

    If you're so "experienced" in open source, you should know better than to come in out of the blue and start picking fights which are unprovoked. The regulars usually won't stand for it, and most people who could help you will look the other way. Noticed much of that, have you?

    The real bottom line? Obviously you want someone to hand you the answer, vice doing a little work yourself. Else you would have a working solution, as many people already do.

    IF you don't like the way WORDPRESS works, it's open source. Submit a patch to WORDPRESS, and see if it becomes part of the core. As for this topic, it should have been addressed on the main WORDPRESS forums, as it's a WORDPRESS core function and has nothing to do with MU.

    Another part of open source is knowing what discussions go where. WordPress goes on the WordPress forums, MU specific goes here. So now that you've wasted everyone's time reading this, please, have a nice day.

  18. thelaw
    Member
    Posted 15 years ago #

    The bottom line Lunabyte - YOU PICKED A FIGHT BY CHOOSING TO WRITE AN OBNOXIOUS, SMART ALECK ANSWER TO MY QUESTION. YOUR ANSWER WAS WRONG, NEEDLESSLY WASTED TONS OF MY TIME, AND NOW YOU'RE EMBARRASSED AND FURTHER MAKING A FOOL OF YOURSELF INSTEAD OF APOLOGIZING. AND YOU STILL CAN'T POINT TO AN ANSWER TO THE QUESTION!!! LOL.

    Now you're blathering about my WP MU question technically being about the "core" and shouldn't be posted here, etc. All your stupid excuses to try to make me look foolish don't change a thing. As most kids are told - if you've got nothing nice to say, don't say it. You openly flamed me and it burned you. So in conclusion after hundreds of your pitiful words, DON'T LISTEN TO LUNABYTE - DON'T BOTHER LOOKING IN GOOGLE ENDLESSLY AND WASTING YOUR TIME FOR THE ANSWER TO THIS QUESTION. There is no confirmed solution yet that will solve this problem of the word 'category' appearing in your URLs, only get you most of the way there. Safest to leave it as is - that's the answer. If I have a custom coded solution, it may change the php files and won't be a smooth fix that won't affect your upgrades. I've wasted enough time Googling thanks to you and more getting ticked off by your immaturity.

  19. lunabyte
    Member
    Posted 15 years ago #

    Well aren't you the big wittle boy.

    I refuse to have a battle with a troll. I attempted to bring to your attention that it was a frequently discussed topic, and that there were plugins in the wild, and you in turn decided to be a dick.

    I refuse to continue to pander to your desire for conflict, as it is clearly shown through your own actions and words, the type of behavior you are exhibiting.

    Immature is your continuing attempts to desecrate this forum, and waste folks time. Again, if you had reservations about my initial response, you could have done something other than become an asshat. However, you failed to do so and instead went off on a tangent. Now, here we are. You're still being an asshat, and refuse to put forth anything less.

    What the hell, you know. I tried, right? It's quite unfortunate that you in turn couldn't do that from the beginning, and instead went off on some hypocritical tyrant try to put words into my mouth. Well, son, you met the guy in the forum that isn't going to be pushed over like that.

    Apologize? For what? Oh, you mean for adding to the conversation by making the mention that it was a well covered topic? You are right. I am sorry I tried to add to the conversation. Had I known you were such an asshat, I would have ignored your thread all together.

    Apologize for anything else? Fat chance. I refuse to apologize for defense of a legitimate response, or anything since in reply to your ranting. Sorry, Charlie. That boat left port after your first reply.

    So, you're still stuck, aren't you? Gee, what a damn shame. Had you NOT been an asshat, and simply replied with something like, "Yeah, I did see a lot of that, but I couldn't find a resolution that worked", then wow, you'd have one. Guess what? Due to your behavior, the NON-HACK plugin I have won't be shared with you today. Bummer, huh? Was it worth it? Feel like a big boy now?

    Ever wonder why none of the other experts here have said a word to you (other than tdjcbe, who also pointed out your behavior), or offered assistance? I think you know, but yet fail to come to your senses and admit you put this off on the bad foot.

    Oh, have a nice day.

  20. thelaw
    Member
    Posted 15 years ago #

    You "tried" to help? You offered assistance? Here's all the "expert" help you provided in your own words - and offering me a second helping of your attitude which got me angry:

    "Guess you need to spend a little more time with Google then."

    I answered the question for the benefit of all and may have worked a solution that works that I'm testing - but you still admittedly haven't provided anything except for more ranting and "alleged information" you're holding back because we're all pr*cks who don't search Google well enough. If this was such a well covered problem it would be easy to find a solution amongst thousands of posts that don't work. So do you like to keep calling yourself an expert so you can sift for paying clients here?

    It looks like virtually all of the other "experts" haven't piped in except your buddy because they know what you did. The best you can say is "but technically what I said was true." Get a clue and grow up.

About this Topic