Title: Random Posts for Query Loop Block
Author: Abhay Rautela
Published: <strong>07.01.2026</strong>
Last modified: 07.01.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://ru.wordpress.org/plugins/random-posts-for-query-loop-block/#description)
 * [Отзывы](https://ru.wordpress.org/plugins/random-posts-for-query-loop-block/#reviews)
 *  [Установка](https://ru.wordpress.org/plugins/random-posts-for-query-loop-block/#installation)
 * [Разработка](https://ru.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.
 * [[
 * 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**
 *  Обновление: **5 месяцев назад**
 *  Активных установок: **Менее 10**
 *  Версия WordPress ** 6.0 или выше **
 *  Совместим вплоть до: **6.9.4**
 *  Версия PHP ** 7.4 или выше **
 *  Язык
 * [English (US)](https://wordpress.org/plugins/random-posts-for-query-loop-block/)
 * Метки:
 * [block-editor](https://ru.wordpress.org/plugins/tags/block-editor/)[gutenberg](https://ru.wordpress.org/plugins/tags/gutenberg/)
   [orderby](https://ru.wordpress.org/plugins/tags/orderby/)[query loop](https://ru.wordpress.org/plugins/tags/query-loop/)
   [random](https://ru.wordpress.org/plugins/tags/random/)
 *  [Дополнительно](https://ru.wordpress.org/plugins/random-posts-for-query-loop-block/advanced/)

## Оценки

Пока что нет ни одного отзыва.

[Your review](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)