Hello @Regnalf,
You are absolutely right to point this out. Here’s the technical reason: when you’re on page/2/ , the native paged variable is passed to the AJAX filter. Since filtered results usually have fewer total posts, the query asks for ‘Page 2’ of a result set that may only have 1 page—returning zero posts, which makes it look broken.
Regarding the pagination outside the container: you are spot on. If the AJAX callback only replaces the inner posts and ignores the outer pagination wrapper, the page numbers stay stuck on the original total. The proper fix is to have the AJAX response return both the updated posts and the updated pagination HTML, then replace both elements via JavaScript.
Also, to ensure filters work on paginated URLs, the AJAX request must explicitly set paged=1 whenever a new filter is applied. This forces the query to start fresh from Page 1.
We fully agree with your documentation suggestion. We’ll add a warning clearly stating that if pagination is placed outside the AJAX target, developers must manually handle updating it via the callback. Thanks for the detailed testing steps—this is very helpful!"
Hope this helps.