Show ‘Recently updated posts’ and increase On-page time on a wordpress website

Reading Time: 7 minutes

If you are into blogging for quite a long you must be knowing the importance of on-page SEO and time on page.  Furthermore, updating the already published posts will help you targetting more keywords and reaching a larger audience. Above this, if you can let your users know about the recently updated posts then you can not only you can bring more internal traffic but also bring more traffic from search engine. If you are using wordpress as your CMS, there’s a problem here. WordPress only shows the last published date and not last modified date by default, so having the timestamp will not help in the long run.

In this post, you will see two major ways to show recently updated posts on your blog posts. I will enclose the best plugins to show recently updated posts and a simple code that will do exactly the same thing.

recently updated posts

How to display “Recently Updated Posts” on your blog sidebar

Aforementioned, this post contains two methods to add recently updates posts on your blog. Let us have a look at the two methods one by one.

Read Also: Start a brand new WordPress blog in 5 minutes and get a free domain and SSL certificate.

#Method 1: By code

This is simplest and with better control. This method involves a piece of code that you need to paste this code in the functions.php file. Here’s the code:

function wpb_lastupdated_posts()
{
// Query Arguments
$lastupdated_args = array(
'orderby' => 'modified',
'ignore_sticky_posts' => '1'
);
//Loop to display 5 recently updated posts
$lastupdated_loop = new WP_Query( $lastupdated_args );
$counter = 1;
$string .= '<ul>';
while( $lastupdated_loop->have_posts() && $counter < 5 ) : $lastupdated_loop->the_post();
$string .= '<li><a href="' . get_permalink( $lastupdated_loop->post->ID ) . '"> ' .get_the_title( $lastupdated_loop->post->ID ) . '</a> ( '. get_the_modified_date() .') </li>';
$counter++;
endwhile;
$string .= '</ul>';
return $string;
wp_reset_postdata();
}
//add a shortcode
add_shortcode('lastupdated-posts', 'wpb_lastupdated_posts');

You can find the functions.php file at Appearance » Editor and the look for a functions.php file in the right panel of the editor.

That’s it the code will work like magic and do the needful. There’s just one small step remaining that you need to do. You need to add the shortcode show below wherever you want the “Recently Updated Posts” section, like your sidebar or footer.recently updated posts short code
Read Also: 10,000+ word glossary you must read to learn about most used SEO terms

This is it, let’s move on to the second method

#Method 2: Plugins for showing recently updated posts 

The best thing about WordPress is the plugins. WordPress has over 55 thousand plugins for pretty much everything. For the context of this post, we will see plugins to add recently updated posts on your blog.

Let’s begin right away.

#Plugin 1: Recently Updated Posts

This plugin is not tested for past three major release. But has better features like controlling the parameters as follows:

  • $num – sets the number of recent posts to display

  • $skip – allows skipping of a number of posts before showing the number of posts specified with the $num parameter

  • $skipUnmodifiedPosts – hide newly published (and yet unmodified) posts

  • $includePages – allows recent pages to be shown with recent posts

  • $hideProtectedPosts – whether or not to display password protected posts

#Plugin 2: Advanced Recent Posts

Again, this plugin is not tested for the past three WordPress versions. But as the name suggests, it has some advanced and better control over how and where you show the recently updated posts. As part of customization, you can place the shortcode to add the last updated posts section and in any theme. Furthermore, you can choose between two pre-defined colors and you can even choose the layouts too. You can set your own scheme or use your own images.

#Plugin 3: WP Latest Posts 

WP Latest posts, unlike the previous two plugins, are tested for the latest WordPress version. WP Latest posts help you place recently updated posts on your blog.

The plugin has 4 main configuration tabs:

  • Select your content source like a post category, page selection, custom post type, tagged content

  • Select your display options like the number of rows, column number, text crop, colors…

  • You can select your image source (1st image or featured), or define a default one

  • Advanced parameters for date format, custom CSS for a perfect news display

#Plugin 4: Recent Posts Widget Extended

Recent posts widget extended is the best plugin to show last updated posts on your blog. I recommend using this plugin as this has maximum control. This plugin is the most advanced and all the actions are done by shortcodes. You can add a thumbnail, excerpt, post date etc to the recently updated posts section and make it more engaging. You can find details of all actions you can perform by the plugin here.

recently updated posts

Final thoughts 

For many bloggers coding is not a piece of cake, they are brilliant at creating content. But when it comes to coding, they freeze. So for bloggers of that category, the plugin would do wonders. For the rest of the bloggers who can manage to code and understand basics of it,  I would recommend you to go with the first method as it is a lighter way of doing the same thing as the plugin does.

The reason why I recommend this way is that plugins lay a lot of stress on the servers to load webpages of your website/blog. On the other hand, the code mentioned in the first method is light and loads incredibly faster as if it is the part of the theme itself.  Furthermore, both methods will yield the same results with cosmetic differences here and there.

Over to you. Have you tried using any of these methods? If not, which one are you going to use for your blog? Let me know in the comment section below. Also, share this information with all your fellow bloggers to make a better ambiance for their readers. Join my mailing list where I share exclusive content right in your inbox and Btricks is on your favorite messaging app, Telegram – Join for instant updates.

Here are some hand-picked articles for you to better understand your wordpress.

I am an SEO consultant by profession and photographer by choice. I have 5+ years of experience in SEO consulting and content marketing. I aim to become the one-stop for all your digital marketing needs