A-Z Index
This article covers how to setup an Alphabetical list of pages within the Classic Editor or the Block Editor.
Classic Editor
To assign a page to the A-Z index template, locate Page Attributes on the right side of the editing screen.
Under Template, select A-Z Index.
For a working example, view the Aurora site’s A-Z Index.
Excluding Pages
By default, the A-Z Index will display every single published page on the site, but it is possible to override that behavior and leave certain pages out.
Find the ID number of the page you wish to exclude. Edit the page in question, and look at the URL bar in your browser. You will see a number there that looks like this (ex. 1799).
Edit the A-Z Index Page. Scroll down and select Custom Fields.
If this box does not appear, select Screen Options at the top right of the page and select the box next to Custom Fields. Scroll down and look for it again.
In the Custom Fields box, add a new custom field called Exclude, and add the number of the page to exclude. When adding multiple pages, use a comma to separate the ID numbers.
Save the changes you made.
Excluding 0-9 From A-Z Index
If your website has no pages with titles beginning with a number, consider excluding 0-9 at the top of your A-Z Index page.
To get rid of these numbers, add the following CSS code to your Custom CSS:
#page-az .btn-group:nth-child(2) {
display: none;
}
Block Editor
There are two options to list pages on a site:
Page List block
The Block Editor has the Page List block that can be used to create an alphabetical list of pages. This option does not have an a-z index on the top. Check out WordPress’s Page List block video and instructions.
UC Custom Query Loop Block
Create a custom query block and change the Page Layout setting to “A-Z Index.”
To ensure these index pages are consistent, choosing this layout will remove many of the other options normally available to this block. In fact, the only options that users have control over is the title and the “Post Type” field, which should default to “page.” If a different post type is desired, it can be entered in that field. Otherwise, the A-Z index will consist of every page on the site, and will render a list of those pages, complete with navigation and search functionality at the top of the page.
Because this functionality has now been moved to a block, these indices can be placed anywhere, even at the bottom or top of other content.