Skip to:
Content
Pages
Categories
Search
Top
Bottom

Any way to eliminate redundancy/weirdness in permalinks (i.e. “forums/forum”)?

  • @spidersilk

    Member

    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?

Viewing 25 replies - 26 through 50 (of 86 total)
  • @synaptic

    Participant

    I forgot to ask, @johnjamesjacoby or @netweb is there a ticket in trac right now to fix this issue? If not, can you please create one?

    thank you!

    @synaptic

    Participant

    sorry to bother others on the thread but I’m trying to contact @hillofbeans (is there a way to pm? or something?)

    thanks!

    @hillofbeans

    Participant

    Hi @Asynaptic I’m subscribed to this thread.

    @lowco2525

    Participant

    Has this been fixed yet? Because I cannot find the solution. This fix would improve a lot of aspects of Bbpress.

    @synaptic

    Participant

    @lowco2525

    No, it hasn’t been fixed yet. In fact, I don’t think there is even a trac ticket!

    But if you read page 1 of this thread you’ll find that it has been an issue with users for more than 7 years and brought up repeatedly.

    There is (was?) even a plugin created to address the issue. The devs did not respond when I asked whether this plugin addressed the issue and if so, would it be incorporated into core.

    It seems that development for bbPress has basically stalled on all fronts:
    http://www.ohloh.net/p/bbpress/commits/summary

    look at the graph of commits! files modified in past 30 days: 14/month (avg for past year: 35 files per month) so dev activity has fallen by more than 50%

    lines modified on avg per month in past year? 21,876
    lines modified on avg for previous month? 21 (no not a typo, just 21)

    I think this is because most of the same team works on both buddypress and bbpress and they have been paying attention to buddypress – which is fantastic! don’t get me wrong 🙂 but this means that bbpress development has been on ice basically.

    Personally I think this issue should be the highest priority because there is nothing more fundamental than permalinks. And there is nothing more wrong than the way permalinks are being done right now with bbpress.

    And don’t forget, this issue has been an ongoing thorn in the side of users for 7+ years and there was an attempted solution in the form of a plugin.

    @lowco2525

    Participant

    Wow, that’s crazy. This is a must fix!! Honestly.

    @anonymized-5853594

    Inactive

    The anwser is actually quite simple… And has been the same all these years.
    Uncheck “Prefix all forum content with the Forum Root slug (Recommended)” under Settings > Forums > Forum Root Slug.
    This gets rid of the /forums/ part and leaves you with the usual /forum and /topic slugs which are prefixed to forums and topics respectively.

    The reason for this “sectioning off forums” is to prevent conflicts with pages. Which it does pretty well, and due to the simpleness of the solution, will probably not be “fixed”. You could submit a ticket on trac, argue your case and submit patches if you want it changed though.

    @synaptic

    Participant

    @tieptoep thanks but I think you’re totally misunderstanding what I and others are suggesting as a solution. Please stay with me and I’ll explain why.

    To clarify:

    Existing permalinks structure for forum:

    mydomain.com/forums/forum/forum-name/

    and if a sub-forum is created, it would be this:

    mydomain.com/forums/forum/”forum-name”/”sub-forum-name”

    Now, compare this to the proper way to do the permalinks:

    mydomain.com/forums/”forum-name”

    and if a sub-forum is created:

    mydomain.com/forums/”forum-name”/”sub-forum-name”

    And for each thread permalink, this is the way it is right now:

    mydomain.com/forums/topic/”thread-permalink-slug”

    But this puts every single forum outside the universe of their respective forum. That is, every thread exists, as a permalink, without any relevance to the forum that contains it! This is both intuitively wrong and just plain wrong for many many reasons. Threads are link “things” which belong in “boxes” (forums), which then may or may not belong in “bigger boxes” (main forums, if there are sub-forums created).

    Instead, this is the proper way to do thread permalinks:

    mydomain.com/forums/”forum-name”/”thread-permalink-slug”

    and if the thread is created inside a sub-forum:

    mydomain.com/forums/”forum-name”/”sub-forum”/”thread-permalink-slug”

    Of course, the slug forums used above can be changed to “discussions” or any other word. But the main point I’m trying to make here is the relative structure of threads and forums to each other, as well as the excision of the unnecessary …/forums/forum/… double.

    This is wrong, again, for many reasons. Among them, it is inelegant, unnecessary, and it introduces a very deep branch unnecessarily which makes for poor SEO.

    So let’s say you have a forum about social media, under what I and others here are proposing, you would have this permalink structure:

    mydomain.com/forums/social-media/

    and let’s say you had sub-forums for facebook, twitter and linkedin:

    mydomain.com/forums/social-media/facebook

    mydomain.com/forums/social-media/twitter

    mydomain.com/forums/social-media/linkedin

    That makes perfect sense, right? But under the current permalinks structure, it currently is:

    mydomain.com/forums/forum/social-media/

    mydomain.com/forums/forum/social-media/facebook

    mydomain.com/forums/forum/social-media/twitter

    mydomain.com/forums/forum/social-media/linkedin

    See the difference? Now that’s nothing. Wait. Let’s start some threads. Here’s where you will really see even a bigger difference that leaves you scratching your head in befuddlement.

    Let’s say I write a thread in the facebook sub-forum with the heading, “I love facebook!”. In the current permalink structure, it would look like this:

    mydomain.com/forums/topic/i-love-facebook

    Notice that looking at this permalink, you or a search engine, has no idea that it is a topic “inside” the facebook sub-forum, which is itself inside the “social media” forum!

    Instead, for some strange reason only clear to the early developers, the topic is just floating by itself in “topic land” and has no relation whatsoever to “forum land”

    But it should look like this:

    mydomain.com/forums/social-media/facebook/i-love-facebook

    Now this permalink makes sense. For one, it follows the progressive location of the thread. First, it is on the site, second, it is within forums, third, it is in the social-media forum, and fourth, it is within the facebook sub-forum which is inside the social-media forum. And finally, the thread is called “i-love-facebook”.

    Hope that makes things clear why your suggestion of simply removing the /forum/ slug does nothing to actually address what is wrong with the permalink structure of bbPress.

    @anonymized-5853594

    Inactive

    @synaptic
    Thanks for the explanation, I must admit that I didn’t read through the whole topic and based my (partial) solution on the prefix slug annoyance. While it works for its intended purpose, I do admit that it is not a very elegant solution.

    The (proper) nesting of forums and topics I do agree on. It works, but it is far from an elegant solution. I too would rather have seen a structure which places topics inside their respective (sub)forums.

    What I do not understand is that if the problem is so widespread, noone has bothered to create a ticket and actually do something about it. Because that is the only way opensource projects work and keep on growing.

    @synaptic

    Participant

    @tieptoep No problem. I’m glad it is clear now.

    It is way beyond ‘inelegant’. It is beyond baffling why it hasn’t been fixed yet. And beyond frustrating that the devs strongly push back instead of simply acknowledging the issue and working on fixing it.

    Unfortunately I’m not a coder and have no idea how to even open a ticket or word it properly in this context. But as a user, it is self-evident that the way bbPress uses permalinks needs fixing.

    Also, through this thread and many others, it is also very obvious that this is a very important and irritating issue that has been brought up going back as far back as 7 years!

    As I mentioned, there is or was a plugin which claimed to fix the issue. I don’t have access to the code and even if I did, there is a chance that the code is now out of date with bbPress’ core development since the plugin would be a few years old.

    All I can do is to clearly state the case for permalinks, their importance and request that it be placed at the highest priority. I hope you and other bbPress users add their voice so that the devs take this seriously.

    Unfortunately, there is no way to prioritize issues in bbPress development. Other projects have a way to measure the community’s voice in terms of what needs to be fixed first. For example, here’s symposium’s page:

    http://www.wpsymposium.com/voting/

    Both buddypress and bbpress need this functionality. Like yesterday. That way issues like this do not fall through the cracks.

    Of course, this is assuming that the dev team is serious about creating a 2 way communication channel with the wider community rather than a 1 way.

    As Matt M. mentioned in a recent video, he measures the success of wordpress in general by how well and fast it reacts to the needs of its community. I would suggest the same applies to bbpress and buddypress.

    @anonymized-5853594

    Inactive

    @synaptic
    I’ve taken a look through trac and found a similar feature request (). Could you take a look at it to see if this is similar enough, if not I’ll see if I could open a new ticket to get this to the attention of the developers.

    @anonymized-5853594

    Inactive

    https://bbpress.trac.wordpress.org/ticket/2258
    The link disappeared, yay for mobile devices… -_-

    @synaptic

    Participant

    @tieptoep thanks, I’ve taken a look at the trac and it seems to definitely have to do with permalinks but I’m not sure if the creator of the ticket (alexvorn2) is referring to the same solution as I and others are asking for (see above examples).

    for example, alexvorn2 has this as an example:

    1) pretty url: http://example.com/forum/subforum/custom_topic_title
    structure will be: http://example.com/%forumparentsnames%/%topicname%

    But the second line doesn’t seem to correspond to the permalink structure shown in the first line. Specifically, he seems to have left out the slug for the subforum! Or maybe I’m missing something.

    It is very disappointing to see JJJ throw this in ‘future releases’ which is basically where trac tickets go to die. And to change the priority: “Priority changed from normal to low” and “Severity changed from normal to minor” and ” Type changed from defect to enhancement” when in fact I and many others would argue there is nothing that is, has been and will continue to be the highest priority ticket (until it is fixed) and there is nothing more severe and this is most definitely a defect, *not* an enhancement.

    These changes sadly tells us, the users, just how much we have failed to communicate to the devs (or how much they have failed to actually listen to us – or a combination of both).

    As for attempts to solve this, @dbungard shares some code in the previous page of this very thread. As well, I linked earlier to several other past attempts at the solution. I think user @mr_pelle was the developer of the bbPress nicer permalinks plugin but that was many years ago (3+?) and he doesn’t seem to be active on the forum. As well, the plugin is nowhere to be found.

    There has been no feedback or response from devs on any of this code, even when another user specifically asks for that in the past page.

    This issue is so fundamental to the very core of bbPress functioning that I question whether it is something that can be hacked together with a plugin, bailing wire and a convoluted .htaccess file.

    @karivan

    Participant

    Hi,

    I had the same problem when I published a new page called Forum. I also tried to find a solution for this permalink problem and I found the following. Start with simple set up. Make a home page and a forum page. Make sure that the home page is static home page, see settings/reading. Make a forums page and make sure that your forum’s page permalink address just below the title ends /forums. There is also some other combination with those page and menu settings that might work, but it is important to check page and menu settings.

    @synaptic

    Participant

    @karivan with respect, I don’t think you are completely grasping what is being discussed here.

    @nicholasdesuza

    Participant

    Revival!

    It gets hilariously worse when running a MultiSite – Calling a SubSite “Forum” – then working around this issue. The bigger your site, the less you want everything to weigh for User loading and Server handling. There’s now an option in the bbPress Settings called ‘Prefix all forum content with the Forum Root slug (Recommended)’ – I’ve unchecked it. I’m willing to bet I run into *at least* one hundred different user issues now that I’ve done so. This was definitely designed for the smaller blog, even with it’s latest updates I’m having unrelated issues not addressed in documentation.

    I’m an advanced User, too. As cool as BuddyPress is, it’s pretty much useless without bbPress integration. As much as people would like to pretend (yep, you’re dreaming) their running their own “social media website”, it’s an unrealistic dream compared to running a Forum. Financing that dream over the Forum is poor form, but w/e.

    By the time it gets addressed, the advanced users with thousands of of hits a day wont change it. Why? Because of the Social Media Integration like Facebook, Twitter, and G+ – NOT BUDDYPRESS (which I run for other much different *fluffy* reasons). Likes and Shares are gold, it’s networking and sales. We will weigh our links; SHARING LINKS and LIKES; over making the url pretty for SEO at that point… no matter how terrific the fix.

    8 years too late pretty much. I know it’s community driven – and that’s respectable. Doesn’t change the bigger picture, though, and imo this plugin outweighs BuddyPress in importance concerning the current evolution of WordPress itself.

    @nicholasdesuza

    Participant

    I’ve provided negativity without solution to my silly issue;

    Unchecking “Prefix all forum content with the Forum Root slug (Recommended)” will remove that slug entirely from the forums listing. That will get the average user most of the way.

    Users with the issue I have running MultiSite – a feature with documentation – I changed the Forum Root to “forumroot” (instead of “Forums”). I then created a new Page called “Forums” and in the content placed “[bbp-forum-index]” – the forum index shortcode.

    Finally, go to Settings/Reading and change “Front page displays” to “A Static Page”. Select the “Forums” Page as the Front Page.

    You should now have “www.website.com/forum/forum/etc.” – although I changed my Single Forum Slug to “content”. So I have “www.website.com/forum/content/etc.”. Had I not made any changes it would have been “www.website.com/forum/forums/forum/etc.”. How redundant for trying to be advanced.

    In the end – “Forums” and “forumroot” are identical. Again suggesting it’s useless.

    *high five*

    @lamordnt

    Participant

    Well this is still an issue and the very first problem I ran into within minutes of installing bbpress. I am no expert as I am new to this plugin but what seems to be a workaround for this is to just name both the forum root and the single slug with the same name (in most cases, “forum”). You will get a red warning in the admin that says “Possible bbPress conflict: Forum slug” but so far it seems to make no difference on the front end. Am I setting myself of future disaster here though?

    I am a little concerned with my choice of bbpress now as I see this has been a well voiced topic of concern for over 7 years and nothing has been done to fix it. Should I be considering a different solution altogether?

    @siparker

    Participant

    the answer is probably. although i would say i am not going to let the last 3 weeks go to waste because of a url rewriting issue.

    I am happy to put in $200 to sponsor this fix. anyone else willing to add something to this and make a bugfix bounty style approach. it might help to kickoff the bbpress development again.

    Basically i want to have the ability to create the forum url permalink structure and the thread permalink structure. as per this ticket, https://bbpress.trac.wordpress.org/ticket/2258

    I dont care where it goes although within the tools > forums would be fine. or under settings permalinks a forum tab there to actually group similar tools in a sensible way.

    If you want to do this development please let me know

    Plugin is required also and must not be htaccess rewrites. As i use nginx not apache htaccess style fixes are not an option which suits everyone.

    @siparker

    Participant

    @netweb this is probably for you btw. as you seem to be the only active dev on bbpress?

    @jonathancbatista

    Participant

    Man, this would be so nice!
    😉

    @siparker

    Participant

    yep. its a shame no one seems to be interested
    even with payment for the cause ? i suppose we need to try and find a freelancer who can submit to the core code after making a plugin perhaps?

    @_az_

    Participant

    I think #2258 is pretty complex to implement but possible. Might take some days to do it i guess.

    Here is my workaround:

    in functions.php:

    /**
     * for nicer permalinks:
     * 
     * from: forums/forum/name -> to forum/name
     * 
     * also required rewrite rules below in myThemeName_addRewriteRules
     */
    function myThemeName_bbp_get_forum_permalink_withoutRootSlug() {
    	return preg_replace( '/(' . bbp_get_root_slug() . '\/)/', '', bbp_get_forum_permalink()); 
    }
    
    function myThemeName_addRewriteRules() {
    	/**
    	 * add rewrite rules for bbpress
    	 */
    	
    	// use this to test instead of clicking Save Changes in Settings -> Permalinks
    	// global $wp_rewrite;
    	// $wp_rewrite->flush_rules();
    
    	add_rewrite_endpoint(get_option('_bbp_forum_slug'), EP_ROOT);
    	add_rewrite_rule('^'. get_option('_bbp_forum_slug') . '/(.*)?','index.php?post_type=forum&name=$matches[1]');
    }
    add_action('init', 'myThemeName_addRewriteRules');

    Replacement in my custom loop-single-forum.php:
    <a href="<?php echo myThemeName_bbp_get_forum_permalink_withoutRootSlug(); ?>">

    Default bbpress templates use it at more places than my theme:

    Found 5 matches of bbp_(get_)?forum_permalink in 4 files.	
    loop-search-forum.php	
    		<a href="<?php bbp_forum_permalink(); ?>" class="bbp-forum-permalink">#<?php bbp_forum_id(); ?></a>      [position 18:18]	
    		<h3><?php _e( 'Forum: ', 'bbpress' ); ?><a href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a></h3>      [position 26:58]	
    loop-search-topic.php	
    			<a href="<?php bbp_forum_permalink( bbp_get_topic_forum_id() ); ?>"><?php bbp_forum_title( bbp_get_topic_forum_id() ); ?></a>      [position 41:19]	
    loop-single-forum.php	
    		<a class="bbp-forum-title" href="<?php bbp_forum_permalink(); ?>"><?php bbp_forum_title(); ?></a>      [position 32:42]	
    loop-single-topic.php	
    				<span class="bbp-topic-started-in"><?php printf( __( 'in: <a href="%1$s">%2$s</a>', 'bbpress' ), bbp_get_forum_permalink( bbp_get_topic_forum_id() ), bbp_get_forum_title( bbp_get_topic_forum_id() ) ); ?></span>      [position 68:102]	

    Feel free to hit the Flattr Button on my page: az.zankapfel.org

    Update: Seems that the breadcrumbs need a hack too… 🙂

    @robkk

    Moderator

    @siparker

    I did contact a dev for you, they did say they would look into it.

    We are also thinking of ways to get new devs interested in contributing to the bbPress project more, because it is a need as some devs move onto other projects.

    @siparker

    Participant

    @Robkk

    Thanks for drawing some attention to it.

    If you want to get devs interested then money always helps.

    possibly have a central “i want this feature” area where people could individually, or as groups, sponsor certain bits of development? they would need to be core devs to be able to bid on the other jobs and do x amount of commits to qualify

    perhaps automattic could sponsor some initial bits to get it kickstarted again? and my contribution to the url bit id be happy to do the first sponsored fix.
    alternatively being part of the “Best” thing might make a differnce. as WP is arguably the best platform to build a site on out there then bbpress should really be the bbest forum software. buddypress is on its way to being the best social platform, but its the new cool and has left bbpress in the dust. and i still believe that forums are th lifeblood of the internet. social is fun and all but its the serious discussions that affect everything that come from forums.

Viewing 25 replies - 26 through 50 (of 86 total)
  • You must be logged in to reply to this topic.
Skip to toolbar