Recommended Free Tools
To keep the newest post out of a WordPress post loop, exclude its post ID with post__not_in. For the main blog index, set that argument with pre_get_posts; for a separate PHP loop, pass it to WP_Query. In the block editor, use the Query Loop block’s exclusion controls. Avoid using offset to skip a post if pagination matters.
Exclude the newest post from the main blog index
Add a pre_get_posts callback to your theme or site plugin. The example below finds the most recently published post, then excludes its ID only from the front-end main home query:
function mysite_exclude_latest_post( $query ) {
if ( is_admin() || ! $query->is_home() || ! $query->is_main_query() ) {
return;
}
$latest_post = get_posts(
array(
'numberposts' => 1,
'post_status' => 'publish',
'orderby' => 'date',
'order' => 'DESC',
)
);
if ( ! empty( $latest_post ) ) {
$query->set( 'post__not_in', array( $latest_post[0]->ID ) );
}
}
add_action( 'pre_get_posts', 'mysite_exclude_latest_post' );
pre_get_posts runs after query variables are prepared and before the query executes. Use the passed $query object’s conditionals, as in the example, to limit the change to the intended query; broad changes can affect other loops in areas such as sidebars and footers. WordPress’s documentation also demonstrates excluding IDs on the home page with post__not_in: pre_get_posts.
Adjust what “latest” means
This sample selects the latest published post overall. If you mean the latest item in a particular post type, category, or other scope, make the ID lookup use that same scope. The separate get_posts() call performs its own retrieval query. If your application already has the ID, use it directly instead.
#1 Best Overall
Keep an existing exclusion list
If another part of your code has already set post__not_in, merge the latest ID into that array rather than replacing the existing exclusions. Otherwise, the callback can unintentionally undo exclusions set elsewhere.
Exclude a post from a custom PHP loop
For a secondary loop in a template, pass the excluded ID in the WP_Query arguments:
$excluded_id = 123; // Replace with the ID determined by your site logic.
$loop = new WP_Query(
array(
'post_type' => 'post',
'posts_per_page' => 10,
'post__not_in' => array( $excluded_id ),
)
);
Use the ID your site logic identifies as the latest post. WordPress documents post__not_in as the query argument for excluding post IDs: WP_Query. If you use get_posts() instead, its exclude argument provides the equivalent exclusion: get_posts().
Choose the right method for the loop
| Loop you are changing | Where to set the exclusion | Pagination consideration |
|---|---|---|
| Main blog home query | pre_get_posts callback, limited to the intended main query |
Exclude by ID rather than shifting results with offset. |
| Custom PHP query | post__not_in in WP_Query, or exclude in get_posts() |
Keep the custom query’s page parameter and exclude by ID. |
| Block editor Query Loop | Use the block’s post exclusion settings | Use the block’s query controls rather than changing an unrelated PHP query. |
Preserve pagination and avoid common traps
Do not use offset as a skip-the-first-post shortcut
An offset shifts results, but WordPress warns that it can override or ignore paged, breaking pagination. Excluding the specific post ID avoids that problem while leaving the query’s page setting in place. See the WP_Query documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Account for static front pages
On a static front page, WordPress documents pagination with page rather than paged. The theme handbook also notes that static front pages are not intended to use the usual previous/next pagination functions: Pagination.
Sticky posts are not excluded automatically
ignore_sticky_posts controls whether sticky posts are moved to the top of results; it does not remove the newest post from the query. To omit a post entirely, exclude its ID with post__not_in.
Do not use query_posts() for this change
query_posts() replaces the main query. WordPress recommends modifying the main query with pre_get_posts, or using WP_Query or get_posts() for general post retrieval: query_posts().
Rank #4
Exclude a post in the Query Loop block
If the loop is a Query Loop block in the block editor, configure exclusions in the block instead of adding PHP for a query it controls. The block’s query configuration supports excluding specific post IDs and excluding the current post: Query Loop block reference.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Quick Recap
Best Value
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.




