Hey folks, I ran into the same annoying issue with CTRL+F on Discourse—posts that aren’t currently on screen just disappear from search because of the lazy-load / unload-from-memory system. Even with 64GB RAM, you can’t search the whole topic in-browser. From what I gather, this is more of an anti-scraping feature than a memory-saving one. Here’s what worked (and safer) alternatives I’ve found:
-
Use the Print View: Add
/printto the end of the topic URL, e.g.,https://forum.example.com/t/topic-name/12345/print. This loads all posts in the topic at once and works with browser search (CTRL+F). The layout is simplified, but perfect for full-text search. -
Scroll Until Everything Loads: Keep scrolling until the lazy-load system has rendered all posts in the DOM. CTRL+F will then find everything. It can be tedious for long threads, but works without extra tools.
-
Use the Discourse API: Every topic has a JSON endpoint like
https://forum.example.com/t/{topic_id}.json. You can extract all posts from thepost_stream.postsarray, open in a text editor, and search comfortably. Safe, official, and works regardless of lazy-load. -
Userscript / Greasemonkey Approach: You can automate full-page post loading with this simple userscript for Chrome/Firefox. It auto-clicks “load more posts” until the topic is fully rendered:
// ==UserScript==
// @name Discourse Load All Posts
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Auto-click "load more posts" to fully render topic for search
// @match https://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function loadAll() {
const button = document.querySelector('.load-more[data-more-url]');
if (button) {
button.click();
setTimeout(loadAll, 500); // wait and try again
}
}
window.addEventListener('load', () => {
setTimeout(loadAll, 1000); // start a second after page load
});
})();
After it’s done, CTRL+F will search everything in the thread.
Export / External Search: Use print view or API JSON to export posts to PDF, HTML, or plain text. Open in an editor like VSCode or Notepad++ for full-text search.
Don’t try server hacks: Penetrating the database or scraping content server-side is illegal and unnecessary. Use API / print view / userscript—they’re all safe and work reliably.
TL;DR: Easiest: /print view. More flexible: API JSON or userscript. CTRL+F works once all posts are loaded in DOM. Hope Discourse team sees this and maybe considers a “full search” option someday—it’s a serious UX problem for anyone doing research or deep topic reading ![]()