Title: Random Posts for Query Loop Block
Author: Abhay Rautela
Published: <strong>जानेवारी 7, 2026</strong>
Last modified: जानेवारी 7, 2026

---

प्लगइन शोधा

![](https://ps.w.org/random-posts-for-query-loop-block/assets/icon-256x256.png?rev
=3434605)

# Random Posts for Query Loop Block

 [Abhay Rautela](https://profiles.wordpress.org/ctrs/) कडून

[डाउनलोड करा](https://downloads.wordpress.org/plugin/random-posts-for-query-loop-block.1.0.5.zip)

 * [तपशील](https://mr.wordpress.org/plugins/random-posts-for-query-loop-block/#description)
 * [पुनरावलोकने](https://mr.wordpress.org/plugins/random-posts-for-query-loop-block/#reviews)
 *  [इंस्टॉलेशन](https://mr.wordpress.org/plugins/random-posts-for-query-loop-block/#installation)
 * [डेव्हलोपमेंट](https://mr.wordpress.org/plugins/random-posts-for-query-loop-block/#developers)

 [समर्थन](https://wordpress.org/support/plugin/random-posts-for-query-loop-block/)

## वर्णन

The Query Loop block in WordPress does not include a “Random” ordering option in
the sidebar UI.
 However, WordPress core _does_ support `orderby = rand` in `WP_Query`.

The problem:
 Using `"orderBy": "rand"` inside a Query Loop block can cause the **
Site Editor preview to fail**, because `rand` is not included in the REST API schema
for posts.

This plugin fixes that by extending the REST API orderby enum so the editor recognizes`"
rand"` as valid.

### ✔ What this plugin does

 * Adds `"rand"` to the REST API `orderby` enum for posts and pages.
 * Allows the Query Loop block to use `"orderBy": "rand"` safely.
 * Prevents JSON errors and broken previews in the Site Editor.
 * Makes “random post” layouts work reliably both in the editor and frontend.

### ⚠ What this plugin does _not_ do

 * It does **not** add a “Random” option to the Query Loop UI dropdown.
    (That UI
   is defined in Gutenberg’s JavaScript.)
 * You must still set `"orderBy": "rand"` manually using the Code Editor.

### Example use case

Want your homepage, blog, quotes site, testimonials, or featured-section to show
**
a different post every time the page loads?**

Install this plugin  open the template  switch to Code Editor  set `"orderBy": "
rand"`.

## स्क्रीनशॉट

[⌊Query Loop block configured with "orderBy": "rand" in the Code Editor.⌉⌊Query 
Loop block configured with "orderBy": "rand" in the Code Editor.⌉[

Query Loop block configured with `"orderBy": "rand"` in the Code Editor.

[⌊Site Editor preview working correctly with random post ordering enabled.⌉⌊Site
Editor preview working correctly with random post ordering enabled.⌉[

Site Editor preview working correctly with random post ordering enabled.

## स्थापना

 1. Upload the plugin folder to `/wp-content/plugins/random-posts-for-query-loop-block/`
    
    or install it via **Plugins  Add New  Upload Plugin**.
 2. Activate the plugin via **Plugins  Installed Plugins**.
 3. Open the **Site Editor** and edit a template or page containing a **Query Loop**
    block.
 4. Switch to **Code Editor**
     (top-right kebab menu  _Code editor_).
 5. Find the `wp:query` block and set:
 6. “orderBy”: “rand”

## नेहमी विचारले जाणारे प्रश्न

### Will this add a “Random” option to the Query Loop sidebar?

No. The dropdown list is defined in Gutenberg’s JavaScript and cannot be modified
by PHP alone.
 You must edit the block’s attributes in **Code Editor**.

### Does this affect frontend queries outside the block editor?

No. It only extends the REST API schema used by the editor.
 WP_Query has natively
supported `orderby = 'rand'` for many years.

### Does this slow down my website?

No extra load is added beyond core WordPress behavior.
 However, `orderby = rand`
can be heavy for very large datasets — this is true with or without this plugin.

## समीक्षा

ह्या प्लगइनसाठी कोणतेही समीक्षण नाही.

## योगदानकर्ते आणि विकसक

“Random Posts for Query Loop Block” हे मुक्त स्रोत सॉफ्टवेअर आहे. पुढील लोक या प्लगइनच्या
निर्मितीत योगदान केले आहे.

योगदानकर्ते

 *   [ Abhay Rautela ](https://profiles.wordpress.org/ctrs/)

[भाषांतर करा “Random Posts for Query Loop Block” तुमच्या भाषेत.](https://translate.wordpress.org/projects/wp-plugins/random-posts-for-query-loop-block)

### विकासातील आग्रह?

[कोड ब्राउझ करा](https://plugins.trac.wordpress.org/browser/random-posts-for-query-loop-block/),
[SVN संग्रहालय](https://plugins.svn.wordpress.org/random-posts-for-query-loop-block/)
तपासा, किंवा [विकास लॉग](https://plugins.trac.wordpress.org/log/random-posts-for-query-loop-block/)
च्या [RSS](https://plugins.trac.wordpress.org/log/random-posts-for-query-loop-block/?limit=100&mode=stop_on_copy&format=rss)
द्वारे सदस्यता घ्या.

## बदलांची यादी

#### 1.0.5

 * Initial release. Adds `rand` to the REST API `orderby` enum so Query Loop can
   safely use random order.

## मेटा

 *  आवृत्ती **1.0.5**
 *  शेवटचा अद्यतन **9 महिने पूर्वी**
 *  सक्रिय स्थापना **20+**
 *  वर्डप्रेस आवृत्ती ** 6.0 किंवा मोठा **
 *  परीक्षित केले आहे **6.9.9**
 *  PHP आवृत्ती ** 7.4 किंवा मोठा **
 *  भाषा
 * [English (US)](https://wordpress.org/plugins/random-posts-for-query-loop-block/)
 * टॅग्ज:
 * [block-editor](https://mr.wordpress.org/plugins/tags/block-editor/)[gutenberg](https://mr.wordpress.org/plugins/tags/gutenberg/)
   [orderby](https://mr.wordpress.org/plugins/tags/orderby/)[query loop](https://mr.wordpress.org/plugins/tags/query-loop/)
   [random](https://mr.wordpress.org/plugins/tags/random/)
 *  [प्रगत दृश्य](https://mr.wordpress.org/plugins/random-posts-for-query-loop-block/advanced/)

## मूल्यांकन

अजून कोणतीही पुनरावलोकने सबमिट केलेली नाहीत.

[आपला अभिप्राय](https://wordpress.org/support/plugin/random-posts-for-query-loop-block/reviews/#new-post)

[सर्व पुनरावलोकने पहा](https://wordpress.org/support/plugin/random-posts-for-query-loop-block/reviews/)

## योगदानकर्ते

 *   [ Abhay Rautela ](https://profiles.wordpress.org/ctrs/)

## समर्थन

काहीतरी सांगायचं आहे का? मदतीची आवश्यकता आहे का?

 [समर्थन फोरम पहा](https://wordpress.org/support/plugin/random-posts-for-query-loop-block/)

## देणगी

आपण हे प्लगइन पुरविण्यात समर्थन करू इच्छिता का?

 [ ह्या प्लगइनला देणगी द्या ](https://ko-fi.com/conetrees)