---
title: "How to Add Ajax Pagination to Search Results in WordPress?"
url: https://nexterwp.com/docs/add-ajax-pagination-to-search-results-in-wordpress/
date: 2024-12-02
modified: 2026-04-14
author: "Aditya Sharma"
description: "Are you looking to add Ajax pagination to the search results in WordPress? If you have a long list of items showing in the search result then adding a pagination..."
image: https://nexterwp.com/wp-content/uploads/2024/12/How-to-Add-Ajax-Pagination-to-Search-Results-in-WordPress_-1024x519.jpg
word_count: 286
---

# How to Add Ajax Pagination to Search Results in WordPress?

## Key Takeaways

- Nexter Blocks' Search Bar block allows users to add pagination to Ajax search results.
- Users can set the number of items displayed in the initial search result using the Posts Per Page section.
- Pagination appears when the Posts Per Page number is lower than the total number of search result items.

Are you looking to add Ajax pagination to the search results in WordPress? If you have a long list of items showing in the search result then adding a pagination can improve the user experience.

With the Search Bar block from the Nexter Blocks, you can easily add a pagination 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-9.png)

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

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

From the **Counter Enable** toggle, you can show or hide the pagination numbers.

From the **Arrow Navigation** toggle, you can show or hide the next and previous buttons for the pagination. 

You can edit the button text, add icons and position the button as well.

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.png)

Depending on the total number of items and the number set in the **Posts Per Page** field, you’ll see a pagination when you make a search which you can use to see all the results.

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

![](https://nexterwp.com/wp-content/uploads/2024/12/searchbar-select-product-demo-2.gif)

## Frequently Asked Questions

**Q: What should I do if Ajax pagination is not showing up in my search results?**
A: If Ajax pagination isn't appearing, check the 'Posts Per Page' setting in the Results Area tab. You need to set a lower number than the total items in your search results for pagination to activate. If this setting is correct and pagination still doesn't show, ensure that the AJAX Search toggle is enabled in the Extra Option tab.

**Q: What is the best way to configure the pagination settings for optimal user experience?**
A: For optimal user experience, set the 'Posts Per Page' to a reasonable number that balances load times and usability. Too many items can overwhelm users, while too few may require excessive navigation. Additionally, consider enabling the Arrow Navigation toggle to provide users with clear next and previous options.

**Q: How does enabling the AJAX Search toggle affect my search results?**
A: Enabling the AJAX Search toggle allows for dynamic loading of search results without refreshing the page, improving user experience. This means users can see results instantly as they type, making it easier to find what they're looking for. It's a key feature of the Nexter Blocks Search Bar block.

**Q: What happens if I set the 'Posts Per Page' to a number higher than my total search results?**
A: If you set the 'Posts Per Page' to a number higher than your total search results, pagination will not appear. This is because there are not enough items to warrant multiple pages. To enable pagination, ensure this number is lower than the total items available in your search results.
