How to Show Random Posts in WordPress

Content that is well-written keeps visitors engaged for a time. However, not giving a reader more information he or she may be interested could result in the visitor leaving. This often causes what’s called a “Bounce Rate” to appear in Google Analytics. You want to keep the number of these as low as possible.

Showing additional content within the post or along side it encourages the visitor to keep reading. This is why many will use random posts in WordPress. It provides additional information within the website the reader may be interested in.

In this WordPress tutorial, I’m going to go over a few ways you can easily add these random posts to your site.

Why Do You Need Random Posts?

Showing additional content works well to give visitors something else to read. Adding content the person may be interested in is a way to pique his or her interest. Instead of hitting the back button or otherwise leaving the site, the visitor may click on the next piece of content.

Random posts also work well when trying to boost the traffic to posts that may be performing poorly. Articles that receive little traffic before may experience a bit of an influx if they are displayed to a visitor.

Showing active posts improves search engine optimization as well. This is especially true if the random post is a piece of evergreen content. Every bit of traffic any individual post receives improves its popularity in sites like Google.

Here are three plugins that work exceptionally well to list posts randomly on your site. You will need to know how to install plugins in order to continue.

Using Advanced Random Posts Widget

The Advanced Random Posts Widget is a useful plugin if you want to show a list in the sidebar. However, it also provides a shortcode that lets you display random posts elsewhere on the site whether it’s in a post or page.

Install and activate the “Advanced Random Posts Widget.”

Advanced Random Posts Widget

Go to the Appearance area of WordPress and click “Widgets.”


Drag the “Random Posts” widget to your sidebar.

Random Posts Widget

When you drop the widget into the sidebar, you’ll see quite a few options available. Let’s go over the side tabs and see how you can customize the layout.

The General tab is the basic core information for the widget. You can set title URLs, CCS classes or insert text and HTML before and after the random posts list. This is useful if you want to track statistics, show banners or add images.

General Widget

Clicking the Posts tab shows settings for how content is delivered. You can alter things like the number of posts to show, types of content or if you want to display items other than published articles like drafts.

Posts Tab

In Taxonomy, you can limit posts according to category and tags. You can also input the taxonomy of the posts you want to display according to their numbers.

Taxonomy Tab

Clicking the Thumbnail tab gives you access to images in the widget. This lets you choose whether to show custom thumbnail sizes of the random posts as well as where to align the graphics.

Thumbnail Tab

The Extras section has a few additional options available. From here, you can alter excerpt length or include a date scheme. You’ll also have the ability to display published dates as well as any modifications to the post.

Extras Tab

You can add your own coding in the Custom CSS area. This is completely optional and will require knowledge about how to code in CSS.

Custom CSS Tab

Once you’ve made your choices, click the “Save” button. Your random posts will now show in the sidebar of your website.

Save Widget

If you want to include random posts within content, you can use the shortcode that comes with this plugin. Go into any post or page and place this shortcode:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ][arpw][/ht_message]

ARPW Shortcode

You can also change the number of posts to display by adding a limit=”x” within the code. By changing “x” to a number, you can show that many random posts. Add this coding if you want a certain number to display. For example, you can show 10 random posts on a page if you input:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ][arpw limit=”10″][/ht_message]

Show Number Posts

WP Random Post Inside

The WP Random Post Inside plugin is a bit more flashy than the previous. There is more customization involved for showing random posts within content itself. You may have seen similar effects on sites that have links in the middle of the article to other content.

Install and activate the WP Random Post Inside plugin.

WP Random Post Inside

Go to the Settings area and click “Wp random post inside Settings.”

Random Post Inside Settings

From here, you can customize how the random post appears on your posts and pages. You can show it according to category and/or tags as well as display a catchy icon next to the link. If you really want it to stand out, you can change the link color of the random post as well as its hover color. Otherwise, the system will just use the default settings.

You can also include background and title colors to give it more flash and pizzazz.

Once you’re done adjusting settings, click the “Save Changes” button.

Save Changes

WP Random Post Inside provides a shortcode to use within WordPress. Luckily, the developer included the different settings you’ll need to modify the code to suit your needs. Look on the right of the settings page and take note of the shortcodes. For this example, I’m just going to copy the primary code:
[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ][wprpi][/ht_message]

Note Shortcode

Go into a post or page and paste the shortcode where you want it. This will display random posts within the preferred location. For instance, you can place the link in between two paragraphs as a way to separate or break up the content.

Paste Shortcode

Once you publish or update, the random post will be live.

Random Post Display

Adding More to Your Website

This is just one of many ways you can improve traffic and engagement of the website. Either of the methods above are easy to implement and may prove to be beneficial to reduce bounce rates and increase visitor time spent on pages. The more interactive you can make the site, the better your statistics will become.

What kinds of things do you use on your website to engage the audience? What post upgrades do you use to accentuate your content?

1 thought on “How to Show Random Posts in WordPress”

  1. Josh, thanks for the helpful article.

    I have a question — my site pages include a sidebar with a random post widget. Each time a page is served a different set of random posts (excerpts) is displayed in the sidebar.

    A problem is that Google indexes the pages and ‘sees’ the random post excerpts as content for the page. So in Google search, a page can show up as matching a search term only because one of the random post excerpts on the page matched the term (not the main content of page).

    But, when a user clicks on the link in Google search results they will see the page with a different set of random post excerpts in the sidebar — no matching text.

    Ideally i’d like to exclude the random post excerpts from Google index ie hide them from Google, but that doesn’t look possible (?).

    If you have any suggestions I’d appreciate it! Thanks.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copy link