Skip to content

Page List: Allow hiding pages from the list - #83123

Open
dhruvikpatel18 wants to merge 2 commits into
WordPress:trunkfrom
dhruvikpatel18:add/page-list-hide-pages
Open

dhruvikpatel18 wants to merge 2 commits into
WordPress:trunkfrom
dhruvikpatel18:add/page-list-hide-pages

Conversation

@dhruvikpatel18

@dhruvikpatel18 dhruvikpatel18 commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

What?

Closes #55801

Adds a "Visible pages" setting to the Page List block, so specific pages can be hidden from the list. Hiding a page also hides its subpages.

Why?

The Page List block shows every published page and updates itself as pages are added, which is why it's the easiest way to build a menu that maintains itself. But it's all-or-nothing: pages that shouldn't be in the main menu, legal pages meant for the footer, a 404 page, a landing page, force the choice between a cluttered menu and giving up automatic updates by detaching the block into individual links.

This adds the missing middle ground: keep the automatic list, leave out the few pages that don't belong in it. New pages still appear on their own, so the list keeps maintaining itself.

This covers the "hide pages" part of issue. The issue also mentions renaming page titles within the menu, and a per-page "Add to menu" checkbox in the page settings. Neither is included here:

  • Renaming is already served by Detach, which converts the list into editable links.
  • A per-page checkbox would add a second place to edit the same menu, a concern the issue itself raises, so it seems worth designing separately rather than folding into this PR

Testing Instructions

  1. Create three pages: "About", "Legal", and "Privacy" as a child of "Legal". Publish all three.
  2. Create a new post and insert a Page List block. All three pages appear, with Privacy nested under Legal.
  3. In the block settings sidebar, open the Settings panel's options menu (⋮) and enable Visible pages.
  4. Uncheck Legal. Both Legal and Privacy disappear from the editor preview, and Privacy's checkbox becomes disabled a subpage can't be shown while its parent is hidden.
  5. Publish and view the post. Only About is listed.
  6. Create another page. It appears in the list automatically, confirming hiding is opt-out rather than opt-in.
  7. Re-check Legal. Both Legal and Privacy come back.

Screenshots or screencast

Screen.Recording.2026-09-18.at.4.23.16.PM.mov

Use of AI Tools

This PR was helped with Claude Opus 5.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Sep 18, 2026
@dhruvikpatel18 dhruvikpatel18 added [Type] Enhancement A suggestion for improvement. [Block] Page List Affects the Page List Block labels Sep 18, 2026
@dhruvikpatel18
dhruvikpatel18 marked this pull request as ready for review September 18, 2026 17:19
@github-actions

Copy link
Copy Markdown

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: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: NekoJonez <nekojonez@git.wordpress.org>

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

This branch has not been deployed

No deployments
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 [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to hide pages in the page list

1 participant