The shortcode lists every page beneath a parent page as a nested bulleted list: the parent’s sub-pages, their sub-pages, and so on down the tree. Each entry links to its page. Use it for a contents list at the top of a long section, or a page index for a policy library, so people can see the whole structure at once.
It shows pages only. It does not list news, tasks, teams or other content types. For a list of direct sub-pages only, with images and excerpts, use the landing page shortcodes.
Add the pagetree shortcode
Type the shortcode where the list should appear, in the Classic Editor, giving the ID of the parent page:
[pagetree id="3142"]
Or select the Insert shortcode button on the editor toolbar, choose Page tree, enter the parent page ID and select Insert.
Attributes of pagetree
id
Required. The ID of the parent page. The list contains everything beneath that page but not the page itself. Find a page’s ID in the address bar when editing it: post.php?post=3142&action=edit means the ID is 3142. You can use the ID of the page the shortcode is on, to list its own descendants, or the ID of any other page.
The id must be a page ID, or 0 for the whole site. Without one the shortcode shows nothing.
Show a sitemap of every page
[pagetree id="0"] lists every published page on the intranet, nested under its parents, as a sitemap. Only pages are included, not tasks, news or other content. On a large intranet this can be a long list, so put it on a page of its own.
What pagetree shows
A nested list of all published pages beneath the parent, to any depth. At each level, pages come in the order set in their Page Attributes box under Order, then alphabetically by title. Draft and private pages are left out. If the parent has no published sub-pages, nothing is shown. When the list includes the page a person is viewing, that entry is marked as the current page so it can be styled differently.
Examples of pagetree
A contents list for the “HR policies” section, where the HR policies page has the ID 3142:
[pagetree id="3142"]
A contents list at the top of the parent page itself: put the shortcode on page 3142 with its own ID.
[pagetree id="3142"]
A page index in a sidebar or on the homepage, showing the whole “About us” section from page 87:
[pagetree id="87"]
