# Clearing all checklists from the current page.

**URL:** https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253
**Category:** Tricks & Techniques
**Created:** [July 4, 2026, 6:10am UTC](https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253 "2026-07-04T06:10:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sushik](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@sushik](https://community.silverbullet.md/u/sushik)
#### Post date: [July 4, 2026, 6:10am UTC](https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253/1 "2026-07-04T06:10:05Z")

</div>

I love checklists, so one feature I wanted is the ability to "clear all" the check boxes with one button.

Here's a short snippet that basically modifies the current page text to accomplish that:

```auto
chklist = chklist or {}

function chklist.clear_checklists()
  return widget.html(dom.button {
    "Clear Checklists",
    class = "clear-checklists-button",
    onclick = function()
      local text = editor.getText()
      local newText = string.gsub(text, "%[[xX]%]", "[]")
      editor.setText(newText)
    end,
  })
end

```

Then, just place the button anywhere in your checklist page (`${chklist.clear_checklists()}`) and you're done!

I did try to modify this to change the attribute directly for tasks with custom task states, but didn't get very far. If that's actually possible, let me know!

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [July 4, 2026, 6:11am UTC](https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253/2 "2026-07-04T06:11:12Z")

</div>

This also comes built in: `Task: Remove Completed`

---

<div class="post-metadata">

### Author: ![sushik](https://community.silverbullet.md/letter_avatar_proxy/v4/letter/s/ecae2f/32.png) [@sushik](https://community.silverbullet.md/u/sushik)
#### Post date: [July 4, 2026, 6:43pm UTC](https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253/3 "2026-07-04T18:43:55Z")

</div>

Remove completed will just remove the item though, this will keep the item but "uncheck" the task.  
I mainly wrote this since I have things like packing lists or procedures that I reuse, but can't be bothered to individually uncheck each box.

---

<div class="post-metadata">

### Author: ![zef](https://community.silverbullet.md/user_avatar/community.silverbullet.md/zef/32/7_2.png) [@zef](https://community.silverbullet.md/u/zef)
#### Post date: [July 4, 2026, 8:37pm UTC](https://community.silverbullet.md/t/clearing-all-checklists-from-the-current-page/4253/4 "2026-07-04T20:37:11Z")

</div>

Ah sorry! Yes different thing 👍
