# Is it possible to filter, search, or refine the Linked Mentions block?

**URL:** https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362
**Category:** General
**Created:** [September 10, 2026, 8:58am UTC](https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362 "2026-09-10T08:58:51Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lakoano](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/l/82dd89/32.png) [@lakoano](https://community.silverbullet.md/u/lakoano)
#### Post date: [September 10, 2026, 8:58am UTC](https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362/1 "2026-09-10T08:58:51Z")

</div>

Hi everyone!

I'm quite new to SilverBullet. First of all, I'd like to say a huge thank you to the author for creating such an amazing tool — its features and capabilities are truly impressive!

I rely heavily on the Linked Mentions block to connect my pages and navigate back links. However, for some of my more frequently referenced pages, the Linked Mentions section has grown quite large, making it difficult to find specific entries.

Is there a way to filter or search within the Linked Mentions block? For example, filtering entries by tag, by another linked page, or simply running a quick search/filter on the list?

I feel like this would completely solve my issue with growing backlink lists.

Thanks in advance for any help or tips!

---

<div class="post-metadata">

### Author: ![Mike](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@Mike](https://community.silverbullet.md/u/Mike)
#### Post date: [September 10, 2026, 12:04pm UTC](https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362/2 "2026-09-10T12:04:44Z")

</div>

Linked Mentions is a widget, generated by the function widgets.linkedMentions(pageName), which you can find in Library/Std/Widgets/Widgets

You could overwrite this function to use some kind of filtering in the query.

---

<div class="post-metadata">

### Author: ![adxsoft](https://community.silverbullet.md/user_avatar/community.silverbullet.md/adxsoft/32/2789_2.png) [@adxsoft](https://community.silverbullet.md/u/adxsoft)
#### Post date: [September 11, 2026, 6:54am UTC](https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362/3 "2026-09-11T06:54:31Z")

</div>

Here's the Linked Mentions override I use. Simply place the code in a space-lua block in any page and it will supercede the default Linked Mentions. I tweaked the template for each Linked Mention entry. You can easily modify the query to apply your own filtering and sorting

````auto
-- priority: 10
widgets = widgets or {}

local mentionTemplate = template.new [==[
*[[${_.ref}|${_.ref}]]*:
> ${_.snippet}

]==]

-- configuration schema
config.define("std.widgets.linkedMentions", {
  type = "object",
  properties = {
    enabled = schema.boolean(),
  }
})

-- configuration default values
config.set("std.widgets.linkedMentions", {
  enabled = true,
})

function widgets.linkedMentions(pageName)
  pageName = pageName or editor.getCurrentPage()
  local linkedMentions = query[[
    from index.tag "link"
    where _.page != pageName and _.toPage == pageName
    order by _.page desc, _.pos
  ]]
  if #linkedMentions > 0 then
    return widget.new {
      markdown = "# Linked Mentions\n"
        .. template.each(linkedMentions, mentionTemplate)
    }
  end
end
```

````

---

<div class="post-metadata">

### Author: ![adxsoft](https://community.silverbullet.md/user_avatar/community.silverbullet.md/adxsoft/32/2789_2.png) [@adxsoft](https://community.silverbullet.md/u/adxsoft)
#### Post date: [October 9, 2026, 7:05am UTC](https://community.silverbullet.md/t/is-it-possible-to-filter-search-or-refine-the-linked-mentions-block/4362/4 "2026-10-09T07:05:24Z")

</div>

The Linked Mentions code you need to override in sb 2.12 has changed slightly. Here is my override in which all I wanted to do was have the Linked mentions show up in page name, descending order, so I just altered the _order by_ line of code

Just include on any page and do a system reload.

```auto
-- priority: 10
widgets = widgets or {}

local mentionTemplate = template.new [==[
**[[${_.page}@${_.start}]]**:
${_.snippet}

]==]

function widgets.linkedMentionsMarkdown(pageName)
  pageName = pageName or editor.getCurrentPage()
  local linkedMentions = query[[
    from r = index.relations()
    where r.page != pageName
      and r.to == pageName
      and r.kind != "co-mention"
    order by r.page desc, r.range[1]
    select mentionTemplate({
      page = r.page,
      snippet = r.snippet,
      start = r.range[1],
    })
  ]]
  if #linkedMentions == 0 then
    return ""
  end
  return table.concat(linkedMentions)
end

function widgets.linkedMentions(pageName)
  local md = widgets.linkedMentionsMarkdown(pageName)
  if md != "" then
    return widget.new {
      markdown = "# Linked Mentions\n" .. md
    }
  end
end

```
