It’s easy to post a link in a text widget in your wordpress blog’s sidebar that when clicked will display a random post found in your blog. You can use anchor text or not. Simply place the code into a text widget and display it at the top of your blog’s sidebar for reader convenience. But did you know that the random post URL can be linked to an image of your choice? This post is a step by step tutorial for wordpress beginners.
Here’s just a little easter egg for you to play with: Try adding
?randomto the end of your WordPress.com URL and it will redirect you to a random post on your blog. You can link to that address like any other, either in your post or a widget. Update: Based on a suggestion in the comments, I’ve added this to the admin bar so when you’re logged in and you hover over “Blog Info” the first menu item is a random post link. — Get Random
Simply replace example URL with the Random Post link in the choice you make below.
Example 1 link without anchor text:
http://example.wordpress.com/?random
Example 2 linked to anchor text: Click for random post
<a href=”http://example.wordpress.com/?random”>Click to read a random post</a>
Example 3 linked to an image:
Draft post
- Create a draft post that you will later delete.
- Select a small image to link to and upload it into your Media Library.
- Fill in the Alternate Text.
- Type “Click for random post” into the Caption.
- Fill in the Description.
- Hover over “Blog Info” on the Admin bar and a dropdown menu will appear.
- Hover over “Random Post” and copy the URL onto your clipboard.
- Paste that URL into Link URL
- Click the “Insert into post” button and when that it complete click the X to close the image details box and return to your draft post.
- Switch to the HTML edior and copy the image code provided there onto your clipboard.
Text Widget
- Proceed to Appearance > Widgets select a text widget and drag and drop it into the position in your sidebar that you want it to appear in and open the widget.
- Paste the code you copied out if the HTML editor into it.
- Click “Save” and “Close“
- View the front of your blog. Click your tmage and view a random post.
- Delete the draft post as you are done.

Hello, very useful your post … but, in case i would like to show a random post from just a category, what must i write? I’m talking about the link
http://example.wordpress.com/?random
I tried to add &category=5 after link but it doesn’t work….
I’m sorry but that’s not possible as far as I know.
Pingback: 6 Easy Ways to Feature Older Content « one cool site
Great, great, great!
I have this cute random post widget now!
Thanks!
I’m glad you like it. Blog on!
Yeah, yeahh! I promise :P ☼
Cool idea. Read it. Re-read it. Got it. Did it. Neat. Thanks.
PS – Love WP help – and appreciate your contribution (run across it often). Thanks again!
Hello there,
Aha! Your random post image is a Christmas one. It looks great. :)
Brilliant, thanks for this :-)
Stupid question? How do I know who is a registered wordpress user?
I answered you in the thread you posted to the support forum. Please see here > http://en.forums.wordpress.com/topic/how-to-who-is-registered-wordpresscom-members?replies=2#post-566964
The ?random link can also be put into a menu, as a custom link, and thereby included in the navigation bar. Some readers really enjoy exploring sites that way.
Yes, I believe that’s a good idea.
Thanks for this (and for your response in the forums). I’ll be following your site for more tips!
Hi Sara,
You’re welcome.
Good idea TT. I’m gonna try it out on one of general info sites.
Hi there,
It’s been a long time since we connected. I’ll have to visit and see what you come up with for an image. :)
I just did it!! Yay!!!
Hi Zeenat
I adore the image you used. It’s perfect for your blog. I clicked it and read your post on gratitude. I need a reminder so I’m glad I tried it out.
♥ TiTi
HI TiTi,
This is such a neat idea! I might just give it a go…I love adding useful widgets to the blog :)
I’ll come back and tell you when I add it… :)
Love and hugs,
Z~
Did it! That was fun!
I visited your blog and the image you used is so cute. :)
This is very clever – I will give it a go thanks TT :)
A ha … I wondered if any regular readers would be takers or not. :)
Thanks for sharing this with us!!!
Hi Sophie,
You’re welcome. As you have a food blog you may want to use a small “foodie” image. :)
I’ll pop in and see what you created later. :)