• On my site with 200 Pages, there is one Page that cannot be selected as a Parent Page – but only in the Block Editor. This Parent Page and many of its children were published before the Block Editor existed.

    If I install the Classic Editor plugin, that Page can be selected as a Parent Page. I can also set it as a Parent Page directly in the database, and it then outputs in wp_list_pages() as expected. But it will not appear in the Block Editor in the dropdown for Parent Page.

    This is true both for new Pages (where I am trying to add the Page as a Parent Page) and existing Pages (where that Page was already set as a Parent Page before, back in the Classic Editor days – it says (no parent) even though a Parent Page is set and correctly outputs hierarchically in wp_list_pages().)

    When the Block Editor is enabled, and I edit a Page, I’ve checked the Network tab of Developer Tools. For some reason, this Parent Page is not returned in either of the two calls to the REST API for Pages. Yet if I call the REST API from my browser directly – two separate calls since 100 are returned per page – the Page is returned in the results of the page-2 API call.

    I have already:
    – Checked the REST API is enabled (querying REST API does return this Page)
    – Checked postmeta (it has the same postmeta as other Parent Pages which do work in the Block Editor)
    – Checked taxonomies (there are no taxonomies assigned to this Page, or to working Pages)
    – Checked Yoast SEO settings (the Page is not noindexed or nofollowed)
    – Deactivated all plugins
    – Switched to Twenty Twenty theme
    – Hard-refreshed the Editor each time
    – Deleted the Page, re-created it with the same slug, and saw that the new Page appeared as a Parent Page in the dropdown (presumably because this gave it a higher ID so it is returned in the first page of REST API results)

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    The page you want being on page 2 of API requests points to the problem. The parent dropdown on the block editor screen also limits API responses to 100, so the page you want never appears in the list. I suppose sites with so many pages is somewhat rare and the devs needed streamline page requests so arbitrarily limited requests to 100. Somewhat rare is not no one, others have reported related issues. The reply I gave to a similar topic ought to apply to your situation.

    Thread Starter webelaine

    (@wpgirl369)

    Thanks, @bcworkz – adding that filter does make the page appear, and that will work for the time being. Much better than having to manually set the parent page directly in the database. I hope very much that pull request #16666 (https://github.com/WordPress/gutenberg/pull/16666) will make it into Core so instead of querying all Pages, the querying can be done on the fly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘One Page cannot be selected as Parent Page in the Block Editor’ is closed to new replies.