4 Easy Ways to Re-Order Blog Posts in WordPress

4 Easy Ways to Re-Order Blog Posts in WordPress:-Do you wish to change the order of your posts in WordPress blog? By default WordPress shows blog posts in reverse chronological order but sometimes you need to move individual’s posts up or down or change their order for many reasons. While it may feel like there is no solution to do this in WordPress, you will be surprise to see how easily you can do change your post orders through various methods.

In this post, we will show you 4 different ways to re-order blog posts in WordPress. You can choose a solution that looks easier & fits your requirements.

Why Re-order Blog Posts in WordPress?

If you just starting a blog, then you don’t need to reorder your posts at present. However as your blog content grows, you would like to implement new ideas to promote content across your site. One of them is to make posts prominently displayed on front page, recent posts, blog page or archive pages.

Now the main issue is WordPress normally shows blog posts in reverse chronological order. There is no option to simply move a post up or down.

There are multiple workarounds that allows you to do the same. Depends on your need, you can use a method that suits your requirements.

Let’s have a look at some methods by which you can easily re-order blog posts on WordPress site.

4 Easy Ways to Re-Order Blog Posts in WordPress

  1. Change Post’s Published Date:- this is the most easiest way to re-order posts using built-in WP functionality. As we know WordPress shows post based on publish date in reverse chronological order. Changing publish date of a post will also change where it displays in the list.

Simply edit the post you want to change order and on the edit screen tap on publish date under documents panel.

It will bring a popup of date & time where you can change posts published date & time. After you have changed date & time click on save changes button.

  1. Use Post Types Order Plugin (Drag & Drop Option):-

If you want to change posts order but don’t want to change posts order then this method is recommend for you.

Initially you need to install & activate Post Types Order plugin. After activation go to Settings>> Post Types Order page to change plugin’s settings.

Here you need to choose post types where you want to enable this plugin. Then click on save settings to store the changes.

Now just go to posts >> All posts page and simply drag & drop posts to reorder them.

  1. Use Sticky Posts Feature in WordPress:- many users just want to reorder blog posts  to highlight a blog post as featured content. WordPress comes with default feature to get that and its called Sticky posts.

This feature allows you to highlight post on top of all other posts on blog page. Simply edit blog post that you should want to pin on top. On edit screen check the box next to “Stick to the front page” option under ‘Document’ panel.  After that click on ‘Update’ button to save changes.

 

Now visit your website and you see the selected post pinned to top. Depending on theme, sticky post will be highlighted differently.

  1. Modify WordPress Query Using Code (Advanced):- this solution requires you to add some code to your WordPress website.

If you are an advanced user and want to customize posts order, then you can modify the default WordPress query.

 

//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’, ‘DESC’ );

    }

}

 

// Hook our custom query function to the pre_get_posts

add_action( ‘pre_get_posts’, ‘wpb_custom_query’ );

 

The above code simply modifies the orderby and order parameters in default WordPress query. However sometime it doesn’t work as expected due to some themes or plugins already modifying default query.  To fix that you may use suppress_filters parameter like this:

 

//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’, ‘DESC’ );

        $query->set( ‘suppress_filters’, ‘true’ );

    }

}

 

// Hook our custom query function to the pre_get_posts

add_action( ‘pre_get_posts’, ‘wpb_custom_query’ );