How to Easily Re-Order Posts in WordPress (Step by Step)
Do you want to change the order of your blog posts in WordPress?
By default, WordPress displays your blog posts in reverse chronological order, with the newer posts first. But sometimes you may need to move specific posts up or down.
In this article, we will share the easiest way to re-order WordPress blog posts, WooCommerce products, and custom post types.
Why Re-Order Blog Posts in WordPress?
As your WordPress blog content grows, you may want to explore different ways to promote content across your website.
For example, you can display specific posts more prominently on the front page, blog page, recent posts, or archive pages.
Or you may need to manually re-order custom post types. For example, if you created a WooCommerce store, then you might like to choose the exact order that your products appear.
Now the problem is that WordPress normally displays your blog posts in a reverse chronological order. There is no option to simply just move a post up and down.
The good news is that there are multiple workarounds that let you do just that.
Let’s take a look at some of the ways you can easily re-order blog posts on your WordPress site:
- Method 1: Change Post’s Published Date
- Method 2: Use Post Types Order Plugin (Drag and Drop)
- Method 3: Use Drag and Drop in WooCommerce
- Method 4: Use Sticky Posts Feature in WordPress
- Method 5: Modify WordPress Query using Code (Advanced)
Video Tutorial
If you prefer written instructions, then please continue reading.
Method 1: Change Post’s Published Date
This is the easiest method and allows you to re-order posts using the built-in WordPress functionality.
As you know that WordPress displays posts based on their publication date in reverse chronological order (newer posts first). Changing a post’s publish date will also change where it appears in the list.
For example, if you wanted to bring an older post up, then you would have to change its date to be newer. Similarly, if you wanted to move a post down, then you can change its date to be older.
Simply edit the post you want to re-order and on the post edit screen click on the publish date under the Document panel.
This will bring up a date and time popup where you can change the post’s published date and time. After you have changed the date/time, click on the ‘Update’ button to save your changes.
You need to select a date relevant to other posts.
For example, if you wanted to display an older post before another post that was published on 8 March, then you need to change the post’s publish date to 9 March.
Method 2: Use Post Types Order Plugin (Drag and Drop)
If you want to re-order posts but don’t want to change their publish dates, then this method is for you.
First, you need to install and activate the Post Types Order plugin. For more details, see our step by step guide on how to install a WordPress plugin.
Upon activation, you need to visit Settings » Post Types Order page to change plugin’s settings.
From here, you need to select the post types where you want to enable the plugin. After that, simply click the ‘Save settings’ button to store your changes.
Now you can just go to Posts » All Posts page and simply drag and drop posts to re-order them.
The Post Order Types plugin also allows you to re-order individual custom post types by drag and drop.
Custom post types let you create different content types for your website. To learn more, see our guide on how to create custom post types in WordPress.
Method 3: Use Drag and Drop in WooCommerce
You could use the Post Types Order plugin to re-order products in your online store, but WooCommerce already supports drag and drop natively.
Simply navigate to the Products » All Products page and click the ‘Sorting’ link at the top of the page. You will then be able to change the order of your products using drag and drop.
To stop sorting, just click the ‘All’ link at the top of the screen.
Method 4: Use Sticky Posts Feature in WordPress
Many users just want to highlight a blog post as featured content. WordPress comes with a default feature to achieve that, and it’s called sticky posts.
The sticky posts feature allows you to highlight a post on top of all other posts on your blog page.
Simply edit the blog post that you want to pin to the top. On the post edit screen, check the box next to ‘Stick to the Front Page’ option under ‘Document’ panel.
After that, click on the ‘Update’ button to save your changes.
You can now visit your website, and you will see the selected post pinned to the top. Depending on your theme, your sticky post will be highlighted differently.
Method 5: Modify WordPress Query using Code (Advanced)
If you are an advanced user and want to customize the post order, then you can modify the default WordPress query.
This method requires you to add code to your theme’s functions.php file. If you haven’t done this before, then see our guide on how to copy and paste the code in WordPress.
For example, take a look at this code snippet. It allows you to display posts in chronological order (older posts first).
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
//function to modify default WordPress query function wpb_custom_query( $query ) { // Make sure we only modify the main query on the homepage if ( $query ->is_main_query() && ! is_admin() && $query ->is_home() ) { // Set parameters to modify the query $query ->set( 'orderby' , 'date' ); $query ->set( 'order' , 'ASC' ); } } // Hook our custom query function to the pre_get_posts add_action( 'pre_get_posts' , 'wpb_custom_query' ); |
This code simply modifies the orderby and order parameters in the default WordPress query.
However, this code may sometimes not work as expected due to some plugins or theme already modifying the default query. To fix that, you can use the supress_filters
parameter like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//function to modify default WordPress query function wpb_custom_query( $query ) { // Make sure we only modify the main query on the homepage if ( $query ->is_main_query() && ! is_admin() && $query ->is_home() ) { // Set parameters to modify the query $query ->set( 'orderby' , 'date' ); $query ->set( 'order' , 'ASC' ); $query ->set( 'suppress_filters' , 'true' ); } } // Hook our custom query function to the pre_get_posts add_action( 'pre_get_posts' , 'wpb_custom_query' ); |
The orderby
parameter comes with many options. See the full list of options on the WP Query code reference page.
We hope this article helped you learn easy ways to re-order blog posts in WordPress. You may also want to see our expert pick of the best WordPress SEO plugins, and our comparison of the best email marketing services for small business.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.