BetterDocs logo
Log in

How to Enable Lazy Load Sidebar Docs & Subcategories in BetterDocs?

With 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 in BetterDocs.

Note: 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.

Lazy Load Sidebar Docs & Subcategories option in BetterDocs Layout settings

Toggle the option to enable it. Afterward, make sure to hit the ‘Save’ button to save your changes.

Note: 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.

Lazy Load Sidebar Docs in BetterDocs: only the active category is expanded

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.

Lazy Load Sidebar Docs in BetterDocs: loading placeholder after clicking a 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.

Lazy Load Sidebar Docs in BetterDocs: docs and subcategories loaded in the sidebar

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.

Note: 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.

Getting Stuck? Feel free to reach out to our dedicated support team and we will help you out with your queries.

Was This Helpful?

We Value Your Feedback

  • Happy
  • Normal
  • Sad
  • 00Days
  • 00Hours
  • 00Mins
  • 00Secs

Create docs with AI, manage them with MCP & reduce support tickets this busy season. Save big with our best 2026 deal.