Easy question. How do I set a limit on the total results for a page that has pagination? I have a site that displays 16 entries per-page, but would like to limit the total results to 200. Is this possible?


2 Answers 2


Pretty easy to do using Stash.

First, make a list of the 200 entries you want to be shown in pages. This line should have no white-space or line returns in it to prevent parsing errors.

{exp:stash:set name="entry_ids" parse_tags="yes"}{exp:channel:entries channel="pages" limit="200" disable="categories|category_fields|custom_fields|member_data|pagination" dynamic="off"}{entry_id}|{/exp:channel:entries}{/exp:stash:set}

Then load the entries for each 16 entry page as normal:

{exp:channel:entries entry_id="{exp:stash:get name='entry_ids' backspace='1'}" 
    parse="inward" paginate="bottom" limit="16" dynamic="off"}
  • +1 for this approach. Might be worth adding that you could disable custom fields for the first {exp:channel:entries} tag for a significant performance boost, as you only need the entry_ids.
    – Tom Davies
    Commented Dec 1, 2012 at 19:20
  • Good suggestion Tom. I added a full disable parameter since none of the optional parts are actually needed. Commented Dec 1, 2012 at 20:22
  • You can even add trim="yes" to the {exp:stash:set} tag which will remove whitespace and allow you to format your code better. Commented Jun 19, 2013 at 3:10

I'm not sure on how to "cap" it at 200, but you could always wrap the {paginate} contents with a conditional to only show to a certain point (ie. 200/16 = 12.5 pages).

{if {current_page} < 13}
          <li><a href="{pagination_url}" class="page-first">First Page</a></li>

          <li><a href="{pagination_url}" class="page-previous">Previous Page</a></li>

          <li><a href="{pagination_url}" class="page-next">Next Page</a></li>

          <li><a href="url/P192" class="page-last">Last Page</a></li>

You may need to tweak the {last_page} hard coded url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.