Skip to main content
revote
VIP ⭐️⭐️⭐️⭐️⭐️
Feb 20, 2026 7:37 AM UTC

Topic visible only to members?

Is there a way to hide a specific topic from users who are not logged in? I know that I can play with category settings, but then all topics get hidden.

I don´t want to create a new category just for one topic.

Any workarounds here?

    9 replies

    Mithila Jayalath
    Helper ⭐️⭐️
    Feb 20, 2026 8:18 AM UTC

    ​@revote whom do you mean by visitors? Is it unregistered or not logged in users?

    Translate
    revote
    revoteAuthor
    VIP ⭐️⭐️⭐️⭐️⭐️
    Feb 20, 2026 8:49 AM UTC

    ​@revote whom do you mean by visitors? Is it unregistered or not logged in users?

    Good point, thanks. I edited my question.

    I ment users who are not logged in.

    Translate
    Mithila Jayalath
    Helper ⭐️⭐️
    Feb 20, 2026 10:27 AM UTC

    You can hide the particular topic from a category using thrid-party scripts. Find the js-thread-id of the topic by inspecting the element and replace it in the below code.

    Also add the url of topic below, so if the guest users directly use the url they will get an 403 error.

    <script>
    document.addEventListener('DOMContentLoaded', function() {
    // Check if the data and user role exist on page load
    if (window.inSidedData && window.inSidedData.user && window.inSidedData.user.role) {

    // Check if the user is an administrator
    if (window.inSidedData.user.role.includes('roles.guest')) {

    // 1. Hide the topic card on the feed/lists
    const adminStyle = document.createElement('style');
    adminStyle.innerHTML = `
    .js-thread-id-5634 {
    display: none !important;
    }
    `;
    document.head.appendChild(adminStyle);

    // 2. Block access to the URL with the Gainsight 403 Page
    if (window.location.href.includes('add url here')) {

    // Stop the page from scrolling
    document.body.style.overflow = 'hidden';

    // Create a full-screen overlay using Gainsight's native HTML structure
    const errorOverlay = document.createElement('div');
    errorOverlay.style.cssText = 'position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #ffffff; z-index: 999999; display: flex; align-items: center; justify-content: center; text-align: center;';

    errorOverlay.innerHTML = `
    <div class="destination_error destination_error--full-height">
    <img class="destination_error_image" alt="Error 403" src="https://d3odp2r1osuwn0.cloudfront.net/2026-02-19-09-57-24-4f73b43356/dist/destination/images/errors/403.png" style="max-width: 350px; margin-bottom: 25px;">
    <div>
    <h2 class="destination_error_message_header bold qa-page-title"><span>Access Denied</span></h2>
    <div class="destination_error_message_description">
    <span>You do not have permission to view this page.</span><br><br>
    <a href="/" class="btn" style="margin-top:10px;">Return to Home</a>
    </div>
    </div>
    </div>
    `;

    // Append the error screen directly to the body
    document.body.appendChild(errorOverlay);
    }
    }
    }
    });
    </script>

     

    Translate
    Mithila Jayalath
    Helper ⭐️⭐️
    Feb 20, 2026 10:38 AM UTC

    ​@revote you can use thrid-party scripts to hide the specific topic. Please refer to the code below. Replace the js-thread-id with your topics id. You can get it by inspecting the element. also add the URL of the topic so if guest users directly use the URL they will see a 403 error.

    <script>
    document.addEventListener('DOMContentLoaded', function() {
    // Check if the data and user role exist on page load
    if (window.inSidedData && window.inSidedData.user && window.inSidedData.user.role) {

    // Check if the user is an administrator
    if (window.inSidedData.user.role.includes('roles.guest')) {

    // 1. Hide the topic card on the feed/lists
    const adminStyle = document.createElement('style');
    adminStyle.innerHTML = `
    .js-thread-id-5634 {
    display: none !important;
    }
    `;
    document.head.appendChild(adminStyle);

    // 2. Block access to the URL with the Gainsight 403 Page
    if (window.location.href.includes('Add-Topic-URL')) {

    // Stop the page from scrolling
    document.body.style.overflow = 'hidden';

    // Create a full-screen overlay using Gainsight's native HTML structure
    const errorOverlay = document.createElement('div');
    errorOverlay.style.cssText = 'position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #ffffff; z-index: 999999; display: flex; align-items: center; justify-content: center; text-align: center;';

    errorOverlay.innerHTML = `
    <div class="destination_error destination_error--full-height">
    <img class="destination_error_image" alt="Error 403" src="https://d3odp2r1osuwn0.cloudfront.net/2026-02-19-09-57-24-4f73b43356/dist/destination/images/errors/403.png" style="max-width: 350px; margin-bottom: 25px;">
    <div>
    <h2 class="destination_error_message_header bold qa-page-title"><span>Access Denied</span></h2>
    <div class="destination_error_message_description">
    <span>You do not have permission to view this page.</span><br><br>
    <a href="/" class="btn" style="margin-top:10px;">Return to Home</a>
    </div>
    </div>
    </div>
    `;

    // Append the error screen directly to the body
    document.body.appendChild(errorOverlay);
    }
    }
    }
    });
    </script>

     

    Translate
    revote
    revoteAuthor
    VIP ⭐️⭐️⭐️⭐️⭐️
    Feb 20, 2026 11:06 AM UTC

    Wow. Thanks. How reliable is this ​@Mithila Jayalath? 😀

    Does this hide topic from crawlers as well?

    Translate
    Mithila Jayalath
    Helper ⭐️⭐️
    Feb 20, 2026 11:25 AM UTC

    This workaround will prevent only guests users from seeing the topic from the UI. Because JavaScript runs "client-side", Gainsight's server still packages up the entire topic including the title, the original post, and all replies and sends it to the guest. The script only slaps a blindfold on the page after the data has already arrived.

    Translate
    Mithila Jayalath
    Helper ⭐️⭐️
    Feb 20, 2026 1:38 PM UTC

    ​@revote this simply hide the topic from the UI for guest users. Because JavaScript runs "client-side", Gainsight's server still packages up the entire topic including the title, the original post, and all replies and sends it to the guest. The script only slaps a blindfold on the page after the data has already arrived.

    Translate
    mitchell.gordon
    Expert ⭐️
    Feb 20, 2026 2:29 PM UTC

    You could create a new location for those content posts. You could build a custom page with a dynamic content widget to bring in posts from each location or a 2:1 container with a sitewide feed. Users without permissions wouldnt be able to see it in the feed and people couldnt tell the difference visually. 

    If the new content location requires permissions, if this is the case it should not be indexed by google search ect.

    Translate
    mitchell.gordon
    Expert ⭐️
    Feb 20, 2026 2:31 PM UTC

    People would have to subscribe to a new content location however. That is the trade off. Might require some coverage via calls with super users, CSMs and an email. Could take a bit to get true traction on it unless you also push the posts in an email to users. 

    Translate