Pages & images

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

Pages & images · · Published 2026-09-22

Library shelves filled with books arranged in rows
Library shelves, every book in its place.

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.

This address once hosted the ShiftThis "Order Pages" plugin, discontinued years ago and not offered here. Current WordPress covers its purpose natively, as this guide explains.

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.

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:

Common surprises

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.