# How to clear debug message from a node or function

**URL:** <https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844>\
**Category:** Feature Requests\
**Created:** [12 November 2019 16:04 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844 "2019-11-12T16:04:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![birdbrain2734](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@birdbrain2734](https://discourse.nodered.org/u/birdbrain2734)\
**Post date:** [12 November 2019 16:04 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/1 "2019-11-12T16:04:35Z")

</div>

Been searching but I don't see a way to clear the debug message bar "programmatically"--either via a node or via JavaScript within a function. Is it possible?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 November 2019 16:19 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/2 "2019-11-12T16:19:07Z")

</div>

Can you clarify what you mean by debug message bar? Do you mean the status display below a node? If so is it a function node? If so then write an empty string to it.

---

<div class="post-metadata">

**Author:** ![birdbrain2734](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@birdbrain2734](https://discourse.nodered.org/u/birdbrain2734)\
**Post date:** [12 November 2019 16:24 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/3 "2019-11-12T16:24:44Z")

</div>

I mean the debug sidebar. I am testing a flow many times and writing debug messages. It would be helpful to clear the debug messages from a node within the flow or via JavaScript.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [12 November 2019 18:00 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/4 "2019-11-12T18:00:15Z")

</div>

> [@birdbrain2734](#):
>
> It would be helpful to clear the debug messages from a node within the flow or via JavaScript.

That would be a handy feature - could save quite a few clicks on the clear debug button

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [12 November 2019 18:21 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/5 "2019-11-12T18:21:22Z")

</div>

_Moved to feature requests_

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [12 November 2019 22:58 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/6 "2019-11-12T22:58:59Z")

</div>

Short answer is no, but - the sidebar will scroll so you can always see the latest messages. If you want to separate "runs" more clearly you could write a node.error message at start time to colour it red in the side bar.  
There is a keyboard shortcut for clearing it if you don't want to do the mouse miles.

---

<div class="post-metadata">

**Author:** ![pcb1962](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/pcb1962/32/10113_2.png) [@pcb1962](https://discourse.nodered.org/u/pcb1962)\
**Post date:** [7 January 2020 11:54 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/7 "2020-01-07T11:54:16Z")

</div>

Perhaps a 'Clear on Deploy' option would be useful, it's what I usually do anyway, click the Debug dustbin on the way up to the Deploy button.

---

<div class="post-metadata">

**Author:** ![dimitrior](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dimitrior/32/49992_2.png) [@dimitrior](https://discourse.nodered.org/u/dimitrior)\
**Post date:** [1 November 2021 09:55 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/8 "2021-11-01T09:55:21Z")

</div>

This a billion times.

---

<div class="post-metadata">

**Author:** ![ProgrammerPaul](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/programmerpaul/32/86068_2.png) [@ProgrammerPaul](https://discourse.nodered.org/u/ProgrammerPaul)\
**Post date:** [20 December 2023 02:41 UTC](https://discourse.nodered.org/t/how-to-clear-debug-message-from-a-node-or-function/17844/9 "2023-12-20T02:41:21Z")

</div>

In case anyone is interested, I just had luck with the @gregoriusrippenstein/node-red-contrib-introspection contrib's ClientCode node. I assigned it to run this JS `$("#red-ui-sidebar-debug-clear").click()`.
