Skip to content

Conversation

@snehapatil2001
Copy link
Contributor

What?

Closes #69608

Increases the Page List block parent control query limit from 100 to 500 pages.## Why?

The Page List block currently cannot be used effectively on websites with more than 100 pages because the parent control dropdown is limited to showing only 100 pages. This makes it impossible for users to select parent pages that are deeper in the hierarchy or later in the alphabetical listing when there are more than 100 pages on the site.

How?

This PR updates the MAX_PAGE_COUNT constant in the Page List block's edit.js file, increasing the limit from 100 to 500 pages. This allows the parent control dropdown to load and display up to 500 pages, making the block usable on larger websites.

Testing Instructions

  1. Create or use a WordPress site with more than 100 pages
  2. Edit a page and insert a Page List block
  3. Click the "Parent Page" dropdown in the block settings
  4. Verify that you can now see and select pages beyond the first 100 pages

@github-actions
Copy link

github-actions bot commented Mar 24, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: snehapatil2001 <snehapatil02@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: wwwFrank <fotodrachen@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

// We only show the edit option when page count is <= MAX_PAGE_COUNT
// Performance of Navigation Links is not good past this value.
const MAX_PAGE_COUNT = 100;
const MAX_PAGE_COUNT = 500;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 100 is the default limit of the REST API; changing it to 500 would result in an error. Additionally, we can't use unbound query here due to the performance issue noted above

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended REST API Interaction Related to REST API [Block] Page List Affects the Page List Block labels Mar 24, 2025
@t-hamano
Copy link
Contributor

Can we close this PR? Similar limitations exist elsewhere:

const MAX_COMMENTS_PER_PAGE = 100;

Perhaps we should discuss the REST API limitation itself.

@t-hamano
Copy link
Contributor

t-hamano commented Jun 4, 2025

Let's close this PR and look for an ideal alternative approach.

@snehapatil2001 Thank you for your efforts!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Page List Affects the Page List Block REST API Interaction Related to REST API [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page List: Parent control query limit is too small

3 participants