Skip Navigation

[Resolved] AJAX Pagination Losing First Page Results

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by theC 1 year, 2 months ago.

Assigned support staff: Waqar.


I am trying to: Create archive with AJAX pagination

Link to a page where the issue can be seen: hidden link

I expected to see: Infinite scrolling with all results

Instead, I got: After a user scrolls halfway down the first "page" of results, the next page loads and the first page disappears. If a user continues scrolling, there is no additional issue, but the first page of results is still missing from the list of results. This is happening with all similar AJAX archives on the site.



Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)


Thank you for contacting us and I'd be happy to assist.

While I can see the issue with the missing first page results on your website's archive, I couldn't reproduce this on my test website. This suggests that something specific to your website is involved.

Looking into your archive page's source code, I noticed that the HTML comment lines which are needed for the infinite scrolling are missing, when the page loads.

Example of normal HTML comments which are wrapped around the infinite scrolling view's page results:

<!-- WPV_Infinite_Scroll --><!-- WPV_Infinite_Scroll_Insert -->
<!-- WPV_Infinite_Scroll -->

Some optimization plugins can strip/remove the HTML comments from the page's mark-up, but if these comments are missing, the AJAX-based infinite scrolling has no way to track where the first page's results end.

I'll recommend testing with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One. If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible plugin that is removing those HTML comments.

I hope this helps and please let me know if you need any further assistance around this.



Thanks for the info. Cloudflare and our server optimizer were minifying the HTML output, which removed the comments. It is working now.