Ordering WordPress pages: the Order attribute, menus and drag-and-drop

WordPress pages have no natural order. By default lists of pages are sorted alphabetically or by date, which is rarely what you want. There are three ways to take control.
How WordPress stores page order
Every post in the database has a numeric field called menu_order. For pages, WordPress exposes it in the editor as Order. It defaults to 0. Functions and blocks that list pages can sort by this number, lowest first, usually falling back to the title when several pages share the same value. Pages also have a Parent, which creates the hierarchy (sub-pages); order then applies among siblings.
Method 1: set the Order attribute
In the block editor, open the page, then the Page tab of the settings sidebar. Under Page Attributes (or the "Order" field in recent versions) you can type a number and choose a parent. In the Pages list you can also use Quick Edit to change the order and parent of several pages without opening them. The fields are described in the WordPress.org article on the Page Attributes panel.
Leave gaps when numbering: 10, 20, 30. Inserting a page between two others then means giving it 15 instead of renumbering everything.
The order attribute affects anything that sorts by menu_order: the Page List block, the classic wp_list_pages() function when told to, many widgets, and themes that build automatic navigation. It does not affect custom navigation menus, which keep their own order.
Method 2: build a navigation menu
Most sites do not want every page in the main navigation anyway. A navigation menu is a hand-picked, hand-ordered list that can mix pages, posts, categories and external links.
- Block themes (Site Editor): edit the header template, select the Navigation block, and add, remove or drag items in the block's list view. If it currently shows a Page List, you can convert it into editable links. See the Navigation block documentation.
- Classic themes: go to Appearance → Menus, add pages, and drag them up, down, and to the right to make sub-items. Assign the menu to a theme location.
A menu's order is independent of the pages' Order values, so you can show pages in one order in the header and another in a sidebar list.
Method 3: drag-and-drop in the Pages screen
Typing numbers gets tedious with dozens of pages. Plugins such as Simple Page Ordering let you drag rows in the Pages list; behind the scenes they simply update menu_order (and the parent, if you drag a page under another). Because they write the same native field, removing the plugin later keeps the order you set. Prefer such tools over plugins that store order in their own tables.
Sorting pages in code
If your theme or a custom block lists pages, ask for the order explicitly. With wp_list_pages():
wp_list_pages( array(
'title_li' => '',
'sort_column' => 'menu_order, post_title',
'child_of' => get_the_ID(), // only sub-pages of the current page
) );
With WP_Query or get_posts():
$children = get_posts( array(
'post_type' => 'page',
'post_parent' => get_the_ID(),
'orderby' => array( 'menu_order' => 'ASC', 'title' => 'ASC' ),
'posts_per_page' => -1,
) );
The array form of orderby lets you sort by order, then by title as a tie-breaker. The full list of accepted values is in the WP_Query order parameters.
Ordering other content types
Posts are a timeline and are ordered by date; WordPress hides the Order field for them. If you need a hand-ordered collection of posts (a "start here" list, a portfolio), consider one of these:
- A navigation menu or a static page that links to the posts in the order you want.
- A custom post type registered with
'supports' => array( 'page-attributes' ), which adds the Order field, sorted withorderby => menu_order. - Some plugins register their own types this way; a property-listings plugin, for example, often creates a "property" type, one of the routes compared in our article on listings for estate agents.
- Sticky posts, which always appear first on the blog home page.
Common surprises
- "I changed the order but the menu didn't move." The header uses a navigation menu, which has its own order. Edit the menu.
- "New pages appear in my navigation automatically." Your theme or Navigation block is using a page list. Replace it with a fixed menu, or untick the classic-menu option that adds new top-level pages automatically.
- "Order works for top-level pages but not sub-pages." Order is compared among siblings. Check that the pages share the same parent.
- "Everything has order 0." Pages with equal values are sorted by the fallback (often the title). Give them distinct numbers.
Keeping structure manageable
If you find yourself needing four or five levels of sub-pages to keep things in order, the structure itself may be the problem. Two levels of hierarchy, a clear main menu, and internal links between related pages are easier for both visitors and search engines than deep trees. Order is a presentation tool; it is not a substitute for a plan of what each page is for.
A predictable page order also helps people who navigate with a keyboard or screen reader, one of the points in our accessible themes checklist.
Thumbnail and image sizes
Which image sizes WordPress creates on upload, how to change thumbnail dimensions, register custom sizes, regenerate existing images and avoid wasted disk space.
Pages & imagesImage captions
How captions work in WordPress: caption versus alt text, adding captions in the Image block and Media Library, styling them, and showing captions in templates.
Pages & imagesWordPress for estate agents
Custom post types, maps, feeds and GDPR, versus listing on the big portals: the honest trade-offs.