How to Display Random CMS Items in Webflow
Learn how to display CMS items randomly in Webflow: JavaScript shuffle and a random order field.
In this tutorial, Sandro, co-founder of the Gemeos Webflow agency, shows you how to display CMS items randomly in Webflow.
Method 1: JavaScript shuffle on load
This method shuffles the items already displayed in the DOM on every page load. Add a cms-list class to your Collection List Wrapper, then add this script to the body:
Method 2: Random order field in the CMS
Add a Number field called "Order" to your collection. Fill it with random values (1 to 1000). Sort your Collection List by this field in ascending order. The result will be "random" but fixed until the next republish. Simple and no code required.
3. Limit the number of items displayed
To display only 3 random items out of 50, set the Collection List limit to 3 in Webflow. The JavaScript shuffle will mix the items before Webflow applies the limit: you'll still see 3 different items on every reload.
Conclusion
Random display improves content discovery. Use cases:
- "Suggested articles" section at the bottom of a blog post
- Client testimonials displayed in different ways
- Highlighting different products on each visit
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.















