# Exlude org-noter-insert notes from being cached as nodes

**URL:** <https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017>\
**Category:** Troubleshooting\
**Created:** [September 8, 2021, 4:46am UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017 "2021-09-08T04:46:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandelbot](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mandelbot](https://org-roam.discourse.group/u/mandelbot)\
**Post date:** [September 8, 2021, 4:46am UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/1 "2021-09-08T04:46:58Z")

</div>

Right now I am using org-noter to annotate PDFs, mostly by calling org-noter-insert-precise-note (which generates an org-heading with an ID).

Currently org-roam is capturing each annotation as an individual node, which is leading to an unmanageable number of nodes in my database.

I am aware of `org-roam-db-node-include-function` from the manual, but am not sure how/whether I can use it to exclude org-noter notes from being cached as nodes in my database.

Thanks!

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [September 8, 2021, 8:48am UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/2 "2021-09-08T08:48:05Z")

</div>

@mandelbot  
As far as I can see, `org-noter` itself does not add an ID to notes by with `org-noter-insert-precise-note`. (My PDF notes have no IDs).

I believe you have additional packages, probably `org-noter-pdftools`, which has this customizing variable:

```auto
(defcustom org-noter-pdftools-use-org-id t
  "When non-nil, an org-id is generated for each heading for linking with PDF annotations and record entry parents."
  :group 'org-noter
  :type 'boolean)

```

If you don’t need IDs, I guess you can try turning it off and see what happens.

Alternatively, [Section 6.1 of the Org-roam manual](https://www.orgroam.com/manual.html#What-to-cache) mentions `ROAM_EXCLUDE` so you should be able to add an additional property either manually or automatically via some custom function.

```auto
* Foo
  :PROPERTIES
  :ID: foo
  :ROAM_EXCLUDE: t
  :END:

```

Edit:  
Option 3 would be to use `org-roam-db-node-include-function`.

The section referenced above contains this sample code:

```auto
(setq org-roam-db-node-include-function
      (lambda ()
        (not (member "ATTACH" (org-get-tags)))))

```

As your Org-noter headings contain `NOTER_PAGE` property, I think you can add something like this.

```auto
(setq org-roam-db-node-include-function
      (lambda ()
        (not (cdr (assoc "NOTER_PAGE" (org-entry-properties)))))))

```

I don’t have time to test this idea; perhaps someone can jump in.

---

<div class="post-metadata">

**Author:** ![gnohz](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gnohz/32/803_2.png) [@gnohz](https://org-roam.discourse.group/u/gnohz)\
**Post date:** [September 8, 2021, 6:07pm UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/3 "2021-09-08T18:07:05Z")

</div>

Thanks @nobiot.  
I tried the first two options by myself and they worked. However, the option 3 is what I was looking for.  
I think in your code there is some mismatches for parentheses, and I used the following in my init.el:

```auto
(setq org-roam-db-node-include-function
          (lambda ()
            (not (cdr (assoc "NOTER_PAGE" (org-entry-properties))))))

```

---

<div class="post-metadata">

**Author:** ![nobiot](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/nobiot/32/159_2.png) [@nobiot](https://org-roam.discourse.group/u/nobiot)\
**Post date:** [September 8, 2021, 6:31pm UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/4 "2021-09-08T18:31:44Z")

</div>

@gnohz Thank you! So your version works, right?

---

<div class="post-metadata">

**Author:** ![gnohz](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/gnohz/32/803_2.png) [@gnohz](https://org-roam.discourse.group/u/gnohz)\
**Post date:** [September 8, 2021, 6:42pm UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/5 "2021-09-08T18:42:32Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![mandelbot](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@mandelbot](https://org-roam.discourse.group/u/mandelbot)\
**Post date:** [September 9, 2021, 7:30pm UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/6 "2021-09-09T19:30:58Z")

</div>

You are right this was an org-noter-pdftools function, and option 3 is also exactly what I was looking for!

---

<div class="post-metadata">

**Author:** ![Muff2n](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@Muff2n](https://org-roam.discourse.group/u/Muff2n)\
**Post date:** [October 4, 2021, 5:23pm UTC](https://org-roam.discourse.group/t/exlude-org-noter-insert-notes-from-being-cached-as-nodes/2017/7 "2021-10-04T17:23:01Z")

</div>

Option 3 worked for me. Thank you people! I initially though it wasn’t working as a solution because I could still see the org-noter-pdf headings as org nodes. However after I ran org-roam-db-clear-all and then org-roam-db-sync they were removed.
