Title: Pagination Bug
Last modified: July 16, 2026

---

# Pagination Bug

 *  [jamesc91](https://wordpress.org/support/users/jamesc91/)
 * (@jamesc91)
 * [3 weeks, 3 days ago](https://wordpress.org/support/topic/pagination-bug-10/)
 * I’m experiencing a reproducible bug with RWPP where adding new products to a 
   sorted category causes the sort order to scramble for products immediately after
   the insertion point.
 * Environment:
    - WordPress with WooCommerce
    - Woodmart theme + Elementor
    - 56 products per page in RWPP
    - Affected categories have 800-12000 products
 * Reproduction steps:
    1. Set up a custom sort order for a category using RWPP (
    2. Bulk add new products to that category
    3. New products appear at the top (assigned menu_order 0 by WooCommerce)
    4. Open RWPP admin for the category and drag the new products down to page 2
    5. Save the new order
 * Result:
   The sort order for products immediately after the insertion point is 
   scrambled. The damage is localised and it does not affect the entire category,
   only the products after where the new products were inserted. In our case approximately
   2.5 pages worth of products around the insertion point were affected, while products
   further away remained in the correct order.
 * The rwpp_sortorder_{term_id} meta values for the affected products appear to 
   be renumbered incorrectly at the page boundary. Our diagnosis is that RWPP is
   recalculating positions relative to the current page rather than the full category,
   causing numbering collisions at page boundaries when an insertion spans multiple
   pages.
 * Debug evidence:
   We have PHP error log evidence showing RWPP firing correctly 
   on the affected categories (“FORCED custom table sorting for category 175”) but
   the Meta Query returning empty after the scramble occurs:
 * PHP message: === RWPP Frontend Query Debug ===
   PHP message: Orderby: menu_order
   titlePHP message: Meta Query: Array()PHP message: Expected Meta Key: rwpp_sortorder_175
 * We also have a pre_get_posts hook at priority 9999 applied as a workaround to
   force the correct orderby on the main query for these categories, which confirms
   the meta values themselves are being corrupted rather than just the query.
 * The rwpp_sortorder_* meta count across the database (44,514 records across 380
   categories) confirms the meta is present and healthy before the scramble and 
   it is the renumbering on insertion that causes the corruption.
 * Could you investigate whether the position recalculation on insertion is page-
   aware rather than category-wide, and whether this is causing boundary collisions
   when products are moved across page breaks?

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpagination-bug-10%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/rearrange-woocommerce-products/assets/icon-256x256.png?rev
   =3421674)
 * [Rearrange Products for WooCommerce](https://wordpress.org/plugins/rearrange-woocommerce-products/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rearrange-woocommerce-products/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rearrange-woocommerce-products/)
 * [Active Topics](https://wordpress.org/support/plugin/rearrange-woocommerce-products/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rearrange-woocommerce-products/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rearrange-woocommerce-products/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [jamesc91](https://wordpress.org/support/users/jamesc91/)
 * Last activity: [3 weeks, 3 days ago](https://wordpress.org/support/topic/pagination-bug-10/)
 * Status: not resolved