You have thousands of posts at your aged WordPress site, now you would like to randomly display them at your main page.

To shuffle your posts, follow this guide:

1. Login to FTP account of your WordPress website.
2. If you are located in root (public_html), go to wp-content/themes/mywordpresstheme folder.
3. Search for index.php and open it with your text editor.
4. Look for the line that contains:

<?php while (have_posts()) : the_post(); ?>

5. Before that line or code, copy the following code:

<?php query_posts($query_string . '&orderby=rand') ?>

Random WordPress Posts Randomly Display WordPress Posts or Shuffle Them
6. Save and replace existing index.php with customized one.

You are done, posts at home page should be now displaying randomly.

Each time you refresh the blog.

6 Comments

  1. I have been looking for that for quite some time … THANK YOU!!!

  2. thehandsomenerd

    WordPress official says that wordpress does not allow FTP access to any blogs.

    Help!

  3. Thank you very much for this code, working perfect.
    Could this cause damages to SEO?
    regards

    • I am quite sure this won’t do any damage to your blog in the matter of SEO. This will just randomly display your posts.

      In case you don’t have time to post fresh content ;)

  4. Gr8, now all my posts are shown randomly. Very nice.

  5. I am trying these instructions but the I can’t find the line mentioned in item #4. I have wordpress 3.4.2 and have an autofocus theme 2.02. Where else might it be? Thanks in advance!

Related Posts