---
title: "How to Add Ajax Lazy Load to Search Results in WordPress?"
url: https://nexterwp.com/docs/add-ajax-lazy-load-to-search-results-in-wordpress/
date: 2024-12-02
modified: 2026-04-14
author: "Aditya Sharma"
description: "Considering adding Ajax lazy load to your WordPress search results? This enhancement can significantly speed up result loading. Initially, it displays a limited number of results, and as users scroll..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Add-Ajax-Lazy-Load-to-Search-Results-in-WordPress_-1024x519.jpg
word_count: 302
---

# How to Add Ajax Lazy Load to Search Results in WordPress?

## Key Takeaways

- Nexter Blocks includes a Search Bar block that enables Ajax lazy load for search results.
- Users can customize loading messages and set the number of items to load on scroll using the Load More/Lazy Load tab.
- To implement lazy load, the Posts Per Page setting must be lower than the total number of search result items.

Considering adding Ajax lazy load to your WordPress search results? This enhancement can significantly speed up result loading. Initially, it displays a limited number of results, and as users scroll down, additional results load, creating a smoother and faster search experience. 

With the Search Bar block from the Nexter Blocks, you can easily add a lazy load feature to the Ajax search result.

*To check the complete feature overview documentation of the Nexter Blocks Search Bar* block, [click here](https://nexterwp.com/docs/add-a-search-bar-in-wordpress/).

***Requirement  - This block is a part of the Nexter Blocks, make sure it's installed & activated to enjoy all its powers.***

[LIVE BLOCK LINK](https://nexterwp.com/nexter-blocks/builder/wordpress-ajax-search-bar/)

To do this, add the Search Bar block on the page or template and follow the steps -

1. Select the appropriate source and type for search.

2. Now go to **Extra Option** tab and enable the **AJAX Search** toggle.

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-ajax-search-11.png)

3. Then go to the **Load More/Lazy Load** tab and select **Lazy Load** from the **Loading Options** dropdown.

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-lazy-load.png)

From the **Loading Text** field, you can customize the text that appears when more items are being loaded, while from the **All Posts Loaded Text** field, you can customize the message that appears when all items are loaded.

Then, from the **More posts on click/scroll** field, you can set how many items will load at once on scroll.

4. After that, go to the **Results Area** tab, and from the **Posts Per Page** section, you can set how many items will load in the initial search result.

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-result-area-post-per-page-2.png)

Depending on the total number of items and the number set in the **Posts Per Page** field, you’ll see more items loading automatically as you scroll down.

> *Note: To have a lazy load, you must set a lower number in the ****Posts Per Page**** field than the total number of search result items.*

## Frequently Asked Questions

**Q: What should I do if the AJAX Search toggle is not enabling?**
A: If the AJAX Search toggle isn't enabling, ensure that the Search Bar block from Nexter Blocks is properly installed and activated. This block is essential for adding lazy load functionality to your search results. If it's installed and still not working, try refreshing your page or checking for any plugin conflicts that might be affecting its functionality.

**Q: What happens if I set the Posts Per Page number too high?**
A: If you set the Posts Per Page number too high, it can prevent the lazy load feature from functioning correctly. For lazy load to work, you need to set a lower number in the Posts Per Page field than the total number of search result items. This ensures that additional results can load as users scroll down, creating a smoother search experience.

**Q: What is the best practice for setting the number of items to load on scroll?**
A: A good practice is to set the number of items to load on scroll in the More posts on click/scroll field based on user experience. Start with a moderate number, such as 5 or 10 items, to avoid overwhelming users. This approach allows for a gradual reveal of content, keeping the search experience smooth and engaging.

**Q: How does Ajax lazy load improve the search experience in WordPress?**
A: Ajax lazy load enhances the search experience by initially displaying a limited number of results and loading more as users scroll down. This method speeds up result loading and reduces the initial load time, making the search process feel faster and more responsive. Users can find what they need without waiting for all results to load at once.
