How I Revamped Our Forum's Visitor Flow

Hello :waving_hand:

I’d like to share how I revamped our forum’s visitor flow. Since our community centers around e-cigarettes, legal regulations and strict 18+ age restrictions require us to keep our topics hidden from the general public. If a visitor tries to open any unauthorized page on our forum, the system blocks access and redirects them to the /login page.

While this rule sounds simple enough, it caused serious UX headaches, which I’ve finally smoothed out using some custom logic.

Why aren’t we using the built-in “Login Required” setting?

The most obvious solution would have been to simply enable the global lock in the admin panel. However, we couldn’t do that for one massive reason: SEO.

If we use the built-in lock, Discourse shuts the door on search engine crawlers (Googlebot, Bing, etc.) as well. This means the forum would lose its rankings on Google, causing us to completely vanish from search results and AI recommendations.

Bots get through and index the content normally, while human visitors are stopped and redirected to the login screen.

The Problem: Lost Visitors

Our custom gateway used to have one major flaw:

The destination was lost: If someone clicked a specific topic from Google, the gateway redirected them to sign in immediately. The visitor lost the exact article they came for because they only saw a login page, causing many to close the site immediately (resulting in a high bounce rate).

The Solution: How the flow works now

We have now made this journey completely frictionless. When a guest arrives via an external link, here is what happens behind the scenes:

  1. Visual teaser (Topic preview card): To avoid hitting the visitor with a cold login wall, an info card appears right above the login form. This instantly pulls in the requested topic’s title, cover image, a short text snippet, the author, and the reply count. This way, the user sees exactly why it’s worth logging in.

  2. Instant redirection to the content: Once the user logs in or registers, Discourse automatically redirects them straight back to the specific topic they wanted to read.

With this logic, the forum remains 100% compliant with strict age-restriction laws, Google can index the pages without a hitch, and the preview card shows visitors exactly what they are unlocking, giving them a clear reason to log in.

12 Likes

I believe that this logic / workflow would also make sense for pretty much all private content in most Discourse instances - and would be superior to the status quo (i.e the built-in “Login Required” setting).

Many of our users hit that same wall when they respond to a notification or a link, but the site isn’t logged in on their device. And they frequently also bounce off it as you describe, saying “it is too hard, I didn’t know if I was in the right place, etc etc”.

I can imagine some sites where privacy is paramount, and where a teaser might not be appropriate. But these are likely in the minority - and the current ‘wall’ really isn’t a great experience for people and at the least could be improved.

Are you able to share more about how you’ve achieved this? Is it via a custom plugin?

2 Likes

My impression is that this approach is directed at strict compliance with age restriction laws, rather than privacy. Indeed, the content at vaperina.cc is easily accessible via JSON endpoints or even directly, with Javascript disabled. More generally, if the intention is to make the information available to web crawlers, then there’s always going to be some way to find it.