Герб Укріїни
Believe in Ukraine and the Armed Forces. Glory to Ukraine!

Default page sorting by date in WordPress

In WordPress, this can be configured in two ways: through a plugin or through code. The most reliable way is to add a small code to functions.php, which will change the order of sorting pages in the admin panel by default.

✔ Option 1: Code in functions.php (recommended)

This fragment sets the sorting by creation date (post_date) in descending order (newer — higher) for the page post type in the admin:

After adding the code: open “Pages” → “All pages” – records will be automatically sorted by date, not alphabetically; if you manually change the sorting in the table, WordPress will save it to the session, but the default will still be the date.

✔ Option 2: Plugin

The Admin Columns or Simple Page Ordering plugin allows you to customize the page display order, but does not set the default sorting as stable as the code. Therefore, the first method is optimal.

Leave a Reply

Your email address will not be published. Required fields are marked *