跳到内容

Query Loop Exclude Current Post

v0.0.8

Lauren @ Small Plugins · 2026年11月18日 上架

Keep the post someone is reading out of your Query Loops, so related-post sections never repeat the page they're on.

正在使用
10 以下
评分
暂无
累计下载
120
最近更新
2026年11月19日
需要 WordPress 5.8.3+已测试到 7.1.5PHP 5.6+

截图

A related posts Query Loop on an article about Easy Pasta Bake. Left as it is, the loop lists the post the reader is already on. With Exclude Current Post switched on, only the other recipes remain.
A related posts Query Loop on an article about Easy Pasta Bake. Left as it is, the loop lists the post the reader is already on. With Exclude Current Post switched on, only the other recipes remain.

A “You might also like” section at the bottom of a post usually pulls from the same category as the post itself, which means the post someone is already reading often shows up in its own related list.

This plugin adds a single toggle to the Query Loop block called Exclude Current Post. Switch it on and that loop leaves out whichever post is being viewed, so the list always shows something else.

How it works

  • Select a Query Loop block, open the block settings sidebar, and turn on Exclude Current Post.
  • The setting belongs to that one block, so you can have several Query Loops on the same page with the toggle on for some and off for others.
  • The post is removed before the posts-per-page limit is applied, so a loop set to show three posts still shows three, not two.
  • It works on the front end and in the editor preview, so what you see while building the page matches what visitors get.

No settings page

There is nothing to configure. The plugin adds the one toggle to the Query Loop block and does nothing else.

Works alongside post selection plugins

If another plugin has already narrowed a loop down to a hand-picked set of posts, the current post is removed from that set rather than being ignored.

External services

This plugin bundles the Small Plugins SDK, which adds a Small Plugins screen to your WordPress admin listing our other plugins.

When an administrator opens that screen, the SDK requests the plugin list from smallplugins.com:

  • Endpoint: https://smallplugins.com/wp-json/small-plugins/v1/plugins
  • When: only while the Small Plugins admin screen is being viewed. The response is cached, so the request is not repeated on every page load.
  • What is sent: no personal data and no site content. The request carries the SDK version and your site’s home URL in the User-Agent header.
  • What is received: the list of Small Plugins products shown on that screen.

No request is made from the front end of your site, and excluding the current post from a Query Loop works whether or not this request succeeds.

This service is provided by Small Plugins. Terms and conditions: https://www.smallplugins.com/legal/terms-and-conditions/ Privacy policy: https://www.smallplugins.com/legal/privacy-policy/

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums