Need some help with your project? Contact me

How to display random results with Views in Drupal 7

Say you want to display some content with Views, make even a slideshow of images (or text or whatever content you may have). But, you want this to appear in random order. No problem. Just go to Sort Criteria, filter down to Global and Select Global: Random. Then you can save and test your View.

Hope this helps!


This views sort criteria works flawlessly. I have built so many websites on Drupal 7 and this is the first i use this. There is much to learn in this charming CMS :)

This doesn't work when you have pagination. The random runs again so it appears as if you have duplicates in your result set.

Thanks for the useful tip for newbies like me


This is really nice thing. I want the random in multiple view panes. Like I have entity reference field for taxonomy term and some contents are tagged with it. On site home page I have different content block for one taxonomy term. now I want like, after some days or lets say randomly all contents should be changed for the other taxonomy term.

How can we achieve such thing?

Any idea?

I think you don't need help after 6 months but it could be useful for those who are searching the answer like me. You can use the module "views_random_seed".

And If i want random trough last 10 nodes?

Does this work in drupal 8? I don't see the random option


This is actually working nicely if we are connected in Drupal but for anonymous user it's not. So I have removed the cache on the view but still have the same problem. Any idea why?


I managed to create a views block with random advertising. But I don't get what's the trigger point for the image to change? Would be awesome to make it change image as soon as visitor is going to a different node on the page. Is that possible?


Add new comment

You can post comments in Markdown and basic HTML tags.
For code blocks, wrap your code within '~~~'. For example:
$var = 'my variable';