Any way to eliminate redundancy/weirdness in permalinks (i.e. “forums/forum”)?
-
I’m in the process of converting a standlone BBpress 1.1 installation into the 2.02 plugin version (well, really, recreating it from scratch in the plugin version, because the importer apparently doesn’t work if your blog actually has any users or content).
And I’ve run into a problem – the default permalink structure for the BBpress plugin is really bizarre. It adds a “forums” slug for the forums area, which is fine and to be expected, but then it also insists on adding an additional “forum” slug before the name of each forum, so that instead of a normal URL like example.com/forums/announcements, you get example.com/forums/forum/announcements, which looks weird and awkward. I tried just removing the forum slug, but that left a double slash in the URL, which my web browser then reduced to a single slash, resulting in a 404 error.
And for posts within forums, instead of the sort of URL you would normally expect – i.e. for a post in the announcements forum, something like example.com/forums/announcements/welcome, or example.com/forums/announcements/12345 or whatever, you have example.com/forums/topic/welcome – there doesn’t appear to be any way to associate the posts with the actual forum they’re in.
Is there any way to fix this? Obviously the “forums/forum” thing is the most important – having the completely useless “topic” slug in the post URLs is annoying and pointless, but the “forums/forum” thing makes it look like I was drunk when I set the forums up or something – I really can’t let it go live with a glitch like that in the URLs. But I’d like to fix the topic issue too if possible. Any ideas?
-
You can change the forums slug in your bbPress setting. Just navigate to Setting > Forums in your dashboard and change the default value in “Archive Slugs” & “Single Slugs”
It’s recommended that you keep the “Single Slugs” enabled, since it’s what differentiate between a topic, tag, reply & user. Just change it to something different.
I’ll second the OPs notion – having something like /forums/forum/bla is… special….
Ofcourse you could make it look like /forum/f/bla but this is still far from ideal – ideally it’d really look like the OP mentioned in the 3rd paragraph..
Any takers?
I have to third this. As a standalone forum CMS it might have made sense, but as a wordpress plugin, it would be ideal if the URLs followed the same structure as wordpress pages (ex: domain.com/forums/actual-forum-name/actual-topic.
Adding extra useless words like /forums/forum/topic/here-is-the-only-part-that-matters is bad for SEO, web designers, admins, visitors, and everyone else.
Also, in case anyone is confused, we understand that you can remove the base from topics or change the words. This is not the point. Please re-read the original post.
“Special” indeed. “No! I promise I was sober when I created this website, sir!”
If there is any way to fix this I would be eager to hear about it. If I figure something out I’ll post it here. If anyone else has, please do the same.
Thanks.
What if you had a tiered forum for example…
General Chat
— Chat
— Forum Post One
— Forum Post Two
– Forum Post One
– Forum Post Two
So you have posts inside the main category, general chat.
Posts inside the section category, chat.
Now what if someone made a post called “Chat” inside General chat.
You would then have duplicate URLs if you removed the topic or forum word in front of them.
To keep them in just makes sure it is safe and you can completely manage your forum without any issues.
Just saying I think they are a good thing.
The URLs do follow the same structure as WordPress, exactly actually.
Keep in mind that WordPress has never needed to have a mixed post-type URL structure, except for the case of attachments (which don’t really count.)
None of the words in the URL are ‘useless’ since they’re all indicative of where the content lives.
bbPress and WordPress are designed to allow those with specific needs and wants to customize the codebase, and contribute the changes they needed up-stream to the parent project. If this is something multiple people would like, I suggest you group up and build it. If it works, and more people want it, we absorb it into bbPress core.
Boom.
Boom indeed!
In the example you came up with, you seem to have come up with your own structure. As far as I can tell, Bbpress’ structure is Forums > Topics > Posts.
So the current hierarchy eliminates the possibility of the duplicate URL in your example. If you had a forum “General Chat” and two separate topics called “chat” they’d have to be in separate forums.
EXAMPLE:
Preferred:
http://www.domain.com/general-chat/topic-one/chat
http://www.domain.com/general-chat/topic-two/chat
Current:
1. http://www.domain.com/forums
changes to
2. http://www.domain.com/forums/forum/general-chat/
when you click a forum, and then changes to
3. http://www.domain.com/forums/topic/topic-one
@Mr Jacoby:
I appreciate your response, and I’ve seen some very helpful posts by you in these forums. Thanks. In this instance, however, are missing our point. In my example above, you can see that the URLs look nothing like wordpress permalinks. End users (and our visitors) are not concerned with how the back end might be similar. We only see that the URLs look silly and lack continuity (specifically switching from forums to forum to topic). They do not reflect the simple forum > topic > post hierarchy. When I said ‘useless,’ I was, of course, speaking in terms of end users and our visitors. I get that bbpress developers use it. I also get that it’d be possible to change (especially since wordpress is already doing what we want).
If wordpress URLs looked like bbpress URLs, I suspect they’d look something like:
http://www.domain.com/pages/page/page-one OR
http://www.domain.com/posts/post/post-one OR
http://www.domain.com/page/page-one
My guess is that this isn’t something that’s going to be possible with bbpress’ plugin unless someone develops it on the side (as you suggested), but please try to at least understand our inquiry instead of pretending like we simply don’t know what we’re talking about.
If anyone has any helpful hints on where one might get started on changing the url structure, it would be greatly appreciated. I see this being an issue that many, many more wordpress users will seek a solution for.
For SEO, and for advertising purposes, it’s much better to remove unnecessary /word/words/more-words-that-dont-help-identify-page-content/ from URLs.
Currently bbPress has the URL structure that is has that is that, you are indeed welcome to write a plugin or contribute to the code base as JJJ wrote above to implement other URL options for bbPress.
If only I had the time and knowledge.
PS netweb – ‘that is has that is that’?! Your grammatical apathy impresses me–and I am serious…not trying to be a jerk.
Whilst agreeing that it isn’t ideal, it’s easy to disguise. Just change “forums” to something like “discussion”.
Users then see a link like:
example.com/discussion/forum/off-topic/
Not too scary for them imo. It reads perfectly well “discussion forum” and like you say, most users don’t care much for the internals of all this and won’t notice/care that there is an extra word that (arguably) doesn’t need to be there.The “do it yourself” attitude can be frustrating as we would if we had the skills! But I appreciate developer’s frustrations too. Surely the compromise is to stick it on the backlog and see if it gains support.
PS. “that it has and that is that” not the most exciting error in the world, you are way too easily impressed my friend š
@presspressperson I was looking at what could happen if you removed what I see as useful parts of the url, of course people will disagree though, it is natural.
After looking at bbPress a bit I am wondering why Topics are not organized under a Forum?
Sure, I’m aware that there are super sticky topics, but apart from that one case will a Topic not always exist under just one forum?
In which case one really wouldn’t need the Forum and Topic categorization…
I’m sure there’s a good reason for why it’s been done this way… just can’t see it at the moment š
I’ve seen numerous threads on this very subject for the last few years and JJJ has been posting the same response every time. It more or less says “This is the way it is. If you don’t like it, come up with your own solution.”
I understand his reasoning for saying that’s just the way it is, but IMO, I wouldn’t have released this product with the URLs in this format. How can a topic be considered part of a forum, yet the URL not represent that?
This is the logical structure. (assuming everything exists in a forums subdirectory):
Viewing a Single Forum:
domain.com/forums/forum-name/
Viewing a Thread (or topic):
domain.com/forums/forum-name/thread-name
With comments being this or something similar:
domain.com/forums/forum-name/thread-name#comment-35
.
This is what we actually get.
Viewing a Single Forum:
domain.com/forums/forum/forum-name
Then click on a Single Thread:
domain.com/forums/topic/thread-name
You lose all acknowledgement that you were in a particular forum. It’s like the threads are just floating about aimlessly…not attached to anything in particular.
If BBPress operated like WordPress, Let’s say that “Forums” are “Categories” and “Topics” are “Posts”. Well, with WordPress, you can set your permalinks to read:
domain.com/category-name/post-name/
So why not be able to do that with BBPress? The problem is that in order to get all of the various settings applied to both Forums and Topics, they have both been created as separate Custom Post Types. The individual Posts in Topics simply have a custom field that ties them to a specific Forum.
Now, I haven’t tested this at all, but in theory it may be possible to tap into some WordPress action and filter hooks and create our own rewrite rules to fix what I see as the biggest flaw with BBPress. I found a thread on another site recently where the user used a custom field value to generate the permalink for a custom post type. That seems to me would be exactly what we need to do here. If I can get some free time, I’ll see if I can get it working and maybe build a plugin to handle it.
If this is the correct way of doing it how do you handle member access privs?
If I set up url based restriction to ‘forum-name’
domain.com/forums/forum-name/as soon as a user is aware of a thread eg. domain.com/forums/topic/thread-name
the url restriction set in ‘forum-name’ is bypassed.There’s no way to use url restriction to set a top level protection and have all threads protected within the forum-name structure.
It’s also conflicting with the logic of the breadcrumb path which shows the correct structure.
Home āŗ Forums āŗ Forum Name āŗ TopicThere must be a way to do this. I am in includes/common/template-tags.php
I see:
/** URLs **********************************************************************/ /** * Ouput the forum URL * * @since bbPress (r3979) * * @uses bbp_get_forums_url() To get the forums URL * @param string $path Additional path with leading slash */ function bbp_forums_url( $path = '/' ) { echo bbp_get_forums_url( $path ); } /** * Return the forum URL * * @since bbPress (r3979) * * @uses home_url() To get the home URL * @uses bbp_get_root_slug() To get the forum root location * @param string $path Additional path with leading slash */ function bbp_get_forums_url( $path = '/' ) { return home_url( bbp_get_root_slug() . $path ); } /** * Ouput the forum URL * * @since bbPress (r3979) * * @uses bbp_get_topics_url() To get the topics URL * @param string $path Additional path with leading slash */ function bbp_topics_url( $path = '/' ) { echo bbp_get_topics_url( $path ); } /** * Return the forum URL * * @since bbPress (r3979) * * @uses home_url() To get the home URL * @uses bbp_get_topic_archive_slug() To get the topics archive location * @param string $path Additional path with leading slash * @return The URL to the topics archive */ function bbp_get_topics_url( $path = '/' ) { return home_url( bbp_get_topic_archive_slug() . $path ); }
I figure there MUST be a way to add the forum to the topics URL. Iām doing this because I have a action based upon the URL string and need to have all things on that forum associated with that at a URL level. I’m more of the design end than the development end of things and though I see it there I cannot seem to bridge the gap.
I was also reading: https://bbpress.trac.wordpress.org/ticket/2258 – has there been any progress here?
Customizing this has taken much longer than expected & I’d like to resolve this. Any thoughts would be appreciated.
TYOr maybe it’s down here
/** * Output the view url * * @since bbPress (r2789) * * @param string $view Optional. View id * @uses bbp_get_view_url() To get the view url */ function bbp_view_url( $view = false ) { echo bbp_get_view_url( $view ); } /** * Return the view url * * @since bbPress (r2789) * * @param string $view Optional. View id * @uses sanitize_title() To sanitize the view id * @uses home_url() To get blog home url * @uses add_query_arg() To add custom args to the url * @uses apply_filters() Calls 'bbp_get_view_url' with the view url, * used view id * @return string View url (or home url if the view was not found) */ function bbp_get_view_url( $view = false ) { global $wp_rewrite; $view = bbp_get_view_id( $view ); if ( empty( $view ) ) return home_url(); // Pretty permalinks if ( $wp_rewrite->using_permalinks() ) { $url = $wp_rewrite->root . bbp_get_view_slug() . '/' . $view; $url = home_url( user_trailingslashit( $url ) ); // Unpretty permalinks } else { $url = add_query_arg( array( 'bbp_view' => $view ), home_url( '/' ) ); } return apply_filters( 'bbp_get_view_link', $url, $view ); }
Please someone help – I am a designer not a programer – honestly I hadn’t realized that bbpress WOULDN”T have the forum name associated with the topic…
@bbpress staff or @moderators
Please review dbungard’s suggestions above and say something, so that ordinary users can feel confident to make use of it.
Thank you.
This URL structure (forums/forum) really makes no sense to me – especially with topics not being ‘in’ a specific forum. What exactly is the reasoning behind it?
I’m with all the non-coders here. This url situation is nuts from a UX and SEO point of view.
Having built over 200 WordPress sites in the last few years, I’m really surprised to find that bbPress has these fundamental structural flaws when it comes to url organization.
This topic was raised 1 year and 9 months ago.
Have we got any further with this?
boy, I don’t know what to say other than what the majority here are saying:
it just is common sense to have the URL structure to be:
1) forums/sub-forum-slug/ instead of forums/forum/sub-forum-slug
and
2) a specific topic or thread URL should include the sub-forum slug like this:
forums/sub-forum/topic-slug (nice, logical progression of general> more specific> most specific location of info)
NOT as it is now:
forums/forum/topic-slug (this DOESN’T show sub-forum where this thread belongs! and it is just plain weird to have forums/forum/topic )
PLEASE, please, p l e a s e change this. For the sake of common sense, for the sake of UI/UX, for the sake of SEO…. for so many reasons.
Thank you.
I would also like to add that this issue has been a concern and raised as long back as 7 years ago:
https://bbpress.org/forums/topic/permalinks-slugs-modification-removing-forum/
looks like someone came up with a solution to this, just needs to be checked and integrated into bbpress core (name of plugin: bbpress “nicer permalinks plugin”)
For all the commno sense folk out there who are wondering why the mods etc are defending this ridiculous situation….
System justification theory (SJT) is a theory that proposes people have a motivation to defend and justify the status quo, even when it may be disadvantageous to certain people.
People have a psychological need to maintain stability and order in their lives. As such, they are motivated to see the status quo as good, legitimate, and desirable.@hillofbeans with respect, I don’t think that is what’s happening exactly. The bbpress team is not jumping up and down with joy to tackle this issue but as jjj said:
bbPress and WordPress are designed to allow those with specific needs and wants to customize the codebase, and contribute the changes they needed up-stream to the parent project. If this is something multiple people would like, I suggest you group up and build it. If it works, and more people want it, we absorb it into bbPress core.
This is why I searched and found previous discussions in the forum and a solution which was arrived at several years ago via a plugin (See above). It doesn’t seem like the creator of the plugin took it anywhere though, other than sharing it on the bbpress forums. They didn’t create a plugin officially at the plugin.wordpress.org or update it, etc.
If I could make a constructive suggestion to the bbpress team, it would be that while they are very busy and it can seem like we are just throwing constant suggestions, critiques, etc. at them, it would be wise to set up a method to gauge the community’s interest or desire for specific issues.
This can be done very simply with something like uservoice or similar ‘suggestion box’ apps where suggestions are shown and community members here can vote on them to show their interest towards them and move them up the priority list.
I made a similar suggestion to the buddypress team and I read from jjj or boone that this inspired the recent survey (hopefully we’ll see the results of said survey soon!)
That was great, btw! at the same time, a survey is a very short lived ‘snapshot’ whereas a uservoice type idea collector and sifter would be continuous
of course, I’m not at all suggesting that we convert the bbpress or buddypress projects to ‘mob rule’! nope. just that when we have such a communication channel, things like this specific issue would be addressed (rather than linger for 7+ years) because there would be transparency and a collaboration between the wider community and the dev team
š
@Asynaptic
I guess I was being slightly facetious with my previous comment.
However, I too have scoured the forums like you, and I was fed up of seeing flippant replies to a multiple enquiries about the same topic.
I love the WP community, but, for these types of reasons I employ a developer more or less full time these days, because I can’t rely on an open-source community to come up with answers in a set time frame.
A voting system/ survey is a great idea, but I have a busy life, and a family to support, so I can’t wait around forever until someone pushes this to the top of their to-do list. I’m for GTD and agile development, I’m not interested in trying to steer an oil tanker.
This permalink situation is a great example. I need this to work. I cannot go forward with the standard bbPress implementation. It goes right against the grain, ignores logic, intuition, as well as SEO and the user experience.
I am not prepared to wait 7 years to sort this out, so I will probably pay my guy to fix this. If he comes up with a good solution, then I’ll share it right back.
But…. I still do not appreciate the paternalistic attitude of some of the ‘elders’ here. It’s unnecessary and patronising.
@hillofbeans I understand, my comments above were more regarding the general approach to the development and involving the community as a partner, they were not directed specifically at this one issue
- You must be logged in to reply to this topic.