To list WordPress posts by the time they were last changed, sort a secondary WP_Query by modified in descending order. Add the_modified_date() if you also want to print an “Updated” date beside each title. These are separate choices: ordering changes which posts appear first, while the date function changes what readers see.
Choose what “recently updated” means
WordPress stores a last-modified timestamp for each post. A list of recently updated posts normally means sorting by that timestamp rather than by publication date.
- Sort by updates: the post with the newest stored modification time appears first.
- Show an update label: each item displays its last-modified date, such as “Updated September 30, 2026.”
- Do both: sort by modification time and print the date in the list.
The timestamp alone does not establish that an edit was substantial. Your site should decide what qualifies as an editorial update; the query uses WordPress’s stored modified value without applying a meaningful-change threshold.
Best code method: a secondary WP_Query
Use a new query when the list is a separate component, such as a sidebar, homepage section, or “Recently updated” block in a theme template. The modified order key sorts by last-modified time, and DESC puts the newest modification first.
<?php
$recently_updated = new WP_Query(
array(
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 10,
'orderby' => 'modified',
'order' => 'DESC',
)
);
if ( $recently_updated->have_posts() ) {
echo '<ul>';
while ( $recently_updated->have_posts() ) {
$recently_updated->the_post();
echo '<li><a href="' . esc_url( get_permalink() ) . '">';
echo esc_html( get_the_title() );
echo '</a> — Updated ';
the_modified_date();
echo '</li>';
}
echo '</ul>';
}
wp_reset_postdata();
?>
What each argument does
post_type => 'post'limits the list to standard blog posts. Change it only if you intend to query a custom post type.post_status => 'publish'prevents drafts and other non-public statuses from appearing.posts_per_page => 10limits the component to ten items; use the number that fits your design.orderby => 'modified'selects the last-modified timestamp instead of publication date.order => 'DESC'places the latest modification at the top.
The title and permalink are escaped before output. Adjust the surrounding HTML and CSS to match your theme. the_modified_date() prints the current post’s modification date and must run inside The Loop.
Why reset post data?
A secondary query temporarily changes the global post context while its loop runs. Call wp_reset_postdata() after the loop so template tags later on the page continue referring to the main post.
Rank #2
Block-editor options
Query Loop block
The Query Loop block is intended for displaying post types from configurable query parameters and visual settings. It can accept query attributes such as order and orderBy. However, the controls exposed in the editor can vary by WordPress release, theme, and block configuration. Insert a Query Loop, open its query settings, and verify that a last-modified or equivalent ordering option is actually available in your installation before relying on it.
If the editor does not expose modified-date sorting, use the PHP query above or a site-specific block implementation. The block can still be useful when its available controls meet your requirement.
Rank #3
Latest Posts block
The Latest Posts block displays recent posts and provides ordering attributes, but its documented default is publication-date ordering. Its interface documentation does not establish that every installation offers last-modified sorting. Use it only when the settings visible in your editor produce the order you need.
When the list is the main archive
A “Recently updated” component is different from changing the site’s primary archive query. For an archive page that should itself be ordered by modification time, investigate the pre_get_posts hook and restrict the change to the intended main query, archive, post type, and front-end context.
Rank #4
Do not use query_posts() to build a secondary list. It replaces the main query and can disrupt pagination, conditional tags, and other theme behavior. WordPress recommends a new WP_Query or get_posts() for an additional listing.
Common adjustments
Show only a particular category
Add an appropriate taxonomy argument, such as a category ID or slug, to the query array. Keep the existing modified and DESC settings so filtering does not change the update ordering.
Best Value
Use a custom post type
Replace post_type => 'post' with the registered post-type name and confirm that the type is publicly queryable and has a meaningful modified timestamp.
Display the original and updated dates
Keep the update label explicit. For example, output the publication date with the updated date separately so readers do not mistake the original publication date for the latest revision.
Quick Recap
Troubleshooting checklist
- Posts still appear in publication order: confirm that
orderbyis exactlymodifiedand thatorderisDESC. - The list includes drafts: set
post_statustopublishand check that no later code broadens the query. - The date is missing or wrong: call
the_modified_date()inside the secondary loop, not before it or after it. - Other template content changes unexpectedly: make sure
wp_reset_postdata()runs after the loop. - The block editor has no modified-date control: verify the installed WordPress version and block settings, then use a custom query when the UI cannot express the required ordering.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

