# Ignore files or headings with certain property

**URL:** <https://org-roam.discourse.group/t/ignore-files-or-headings-with-certain-property/3619>\
**Category:** Troubleshooting\
**Created:** [October 16, 2024, 8:31pm UTC](https://org-roam.discourse.group/t/ignore-files-or-headings-with-certain-property/3619 "2024-10-16T20:31:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![starring](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@starring](https://org-roam.discourse.group/u/starring)\
**Post date:** [October 16, 2024, 8:31pm UTC](https://org-roam.discourse.group/t/ignore-files-or-headings-with-certain-property/3619/1 "2024-10-16T20:31:47Z")

</div>

I would like org-roam to ignore headings (but not the whole file) that have an `:id:` property.

I think a nice way would to add an an “org-roam-ignore” property to the heading.

Is this possible (with org-roam-file-exclude-regexp)?

---

<div class="post-metadata">

**Author:** ![dmg](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dmg](https://org-roam.discourse.group/u/dmg)\
**Post date:** [October 16, 2024, 11:29pm UTC](https://org-roam.discourse.group/t/ignore-files-or-headings-with-certain-property/3619/2 "2024-10-16T23:29:05Z")

</div>

> [@starring](#):
>
> I think a nice way would to add an an “org-roam-ignore” property to the heading.

What is your use case? You can use a function to ignore certain types of nodes when searching.

Here is an example. I only want to find nodes that have PROJ or AREA todo keyword. I create a function dmg-org-roam-prarea-visit that behaves like org-roam-node-find. You can add a specific tag to those nodes you want to exclude and if the node has that tag, then return nil, otherwise return t

```
 (defun dmg-org-roam-filter-project-or-area (node)
   "return t if node is PROJ or AREA"
   (member (org-roam-node-todo node) '( "PROJ" "AREA"))
   )
 

 
 (defun dmg-org-roam-prarea-visit ()
   (interactive)
   (org-roam-node-find nil nil 'dmg-org-roam-filter-project-or-area))
 )

```

---

<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:** [October 17, 2024, 6:42am UTC](https://org-roam.discourse.group/t/ignore-files-or-headings-with-certain-property/3619/3 "2024-10-17T06:42:10Z")

</div>

> [@starring](#):
>
> I think a nice way would to add an an “org-roam-ignore” property to the heading.
> 
> Is this possible (with org-roam-file-exclude-regexp)?

I don’t think so. `org-roam-file-exclude-regexp` works on file names, not headings (headlines) within files.

Why not use `"ROAM_EXCLUDE"` property? (“What to Cache” section on [Org-roam User Manual](https://www.orgroam.com/manual.html#What-to-cache)).

**EDIT** : Sorry, earlier I missed: `"ROAM_EXCLUDE"` prop. Custom function is for a more complex scenario.

For more complex conditions, you can also use this customizing variable. You can set your own custom function to it.

```auto
(defcustom org-roam-db-node-include-function (lambda () t)
  "A custom function to check if the point contains a valid node.
This function is called each time a node (both file and headline)
is about to be saved into the Org-roam database.

If the function returns nil, Org-roam will skip the node. This
function is useful for excluding certain nodes from the Org-roam
database."
  :type 'function
  :group 'org-roam)

```
