Avec BetterDocs, you can speed up a large knowledge base by enabling Lazy Load Sidebar Docs & Subcategories. Once it is turned on, the documentation sidebar loads the docs of the active category only. The docs and subcategories of every other category are fetched when a visitor expands that category.
Follow this step-by-step guideline below to find out how to enable Lazy Load Sidebar Docs & Subcategories dans BetterDocs.
Remarque: This feature is available in BetterDocs 4.8.0 and later versions. It is turned off by default, so make sure you have installed & activated BetterDocs and updated it to the latest version.
How Does Lazy Load Sidebar Docs & Subcategories Work? #
By default, the documentation sidebar loads every category together with all of its docs and subcategories, even the ones that are collapsed. On a knowledge base with hundreds of categories, this makes the page heavy and slow to open.
Once you enable Lazy Load Sidebar Docs & Subcategories, the sidebar works as follows:
- The category of the doc your visitor is reading loads with the page as usual, so the active doc stays highlighted.
- Every other category shows its title only, without loading the docs inside it.
- When a visitor clicks on a category, a short loading placeholder appears and the docs and subcategories of that category are loaded right there.
- A category that has already been opened does not load again on the same page.
In our tests on a knowledge base with 640+ categories, the page size went down from 3.74 MB to 1.04 MB and the page response time went down from around 6 seconds to 0.7 seconds.
Step 1: Enable Lazy Load Sidebar Docs & Subcategories #
First, open your WordPress Dashboard and navigate to BetterDocs โ Settings โ Layout โ Documentation Page. Under the โGeneralโ section, you will find the โLazy Load Sidebar Docs & Subcategoriesโ option.

Toggle the option to enable it. Afterward, make sure to hit the โSaveโ button to save your changes.
Remarque: This option works on the sidebar only. So, make sure that you have enabled โSidebar Category Listโ from BetterDocs โ Settings โ Layout โ Single Doc โ General.
Step 2: Check the Sidebar on Your Documentation #
Now, open any doc of your knowledge base from the front end. You will see that only the category of the current doc is expanded in the sidebar, and the rest of the categories are collapsed.

Next, click on any other category from the sidebar. A loading placeholder will appear for a moment while BetterDocs fetches the docs of that category.

Once the loading is done, all the docs and subcategories of that category will be displayed in the sidebar. This is how the sidebar keeps your documentation pages lightweight without hiding any doc from your visitors.

Step 3: Enable Lazy Load in Elementor & Gutenberg #
If you have designed your documentation pages with Elementor or Gutenberg, you can control this feature for each sidebar separately.
In Elementor, click on the โBetterDocs Sidebarโ widget and go to the โContentโ tab. Under the โQueryโ section, turn on the โLazy Load Docs & Subcategoriesโ option and update the page.
In Gutenberg, click on the โBetterDocs Sidebarโ block and open the block settings. Under the โQueryโ section, enable the โLazy Load Docs & Subcategoriesโ toggle and save the page.
Remarque: The โBetterDocs Category Gridโ widget and block come with the same option. Enable it only when you are using the Category Grid as a sidebar. If your Category Grid is placed anywhere else, keep this option turned off.
Things to Keep in Mind #
- Docs inside the collapsed categories are loaded on click. So, they are not a part of the page until a visitor expands that category.
- This option works on the sidebar only. Your built-in documentation homepage stays the same.
- If you do not see the change on the front end, clear the cache of your caching plugin and reload the page.
- To go back to the default behavior, simply toggle off the โLazy Load Sidebar Docs & Subcategoriesโ option and hit the โSaveโ button.
This is how easily you can enable Lazy Load Sidebar Docs & Subcategories in BetterDocs and make your large knowledge base load faster.
รtre coincรฉ? N'hรฉsitez pas ร contacter notre dedicated support team et nous vous aiderons avec vos questions.






