# Possible to ignore directories within the org-directory?

**URL:** https://org-roam.discourse.group/t/possible-to-ignore-directories-within-the-org-directory/2454
**Category:** Troubleshooting
**Created:** [February 14, 2022, 9:04pm UTC](https://org-roam.discourse.group/t/possible-to-ignore-directories-within-the-org-directory/2454 "2022-02-14T21:04:27Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![throughnothing](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/throughnothing/32/1095_2.png) [@throughnothing](https://org-roam.discourse.group/u/throughnothing)
#### Post date: [February 14, 2022, 9:04pm UTC](https://org-roam.discourse.group/t/possible-to-ignore-directories-within-the-org-directory/2454/1 "2022-02-14T21:04:27Z")

</div>

The tool that I use to sync my org directory sometimes will store old revisions of modified files into a .directory within my org directory root. When org-roam finds these it gives me lots of issues as they are duplicates of files in the main org directory (by id). Is there a property to have org-roam ignore this specific subdirectory?

---

<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: [February 14, 2022, 9:47pm UTC](https://org-roam.discourse.group/t/possible-to-ignore-directories-within-the-org-directory/2454/2 "2022-02-14T21:47:33Z")

</div>

I believe you can use one of these options in the [manual](https://www.orgroam.com/manual.html#What-to-cache). My guess would be that you can have a custom function to exclude files if they are part of `.directory` with using `org-roam-db-node-include-function` and something like `file-in-directory-p. See the example in the manual.

---

<div class="post-metadata">

### Author: ![liam](https://avatars.discourse-cdn.com/v4/letter/l/b9e5f3/32.png) [@liam](https://org-roam.discourse.group/u/liam)
#### Post date: [March 26, 2022, 10:32pm UTC](https://org-roam.discourse.group/t/possible-to-ignore-directories-within-the-org-directory/2454/3 "2022-03-26T22:32:16Z")

</div>

For this case, `org-roam-file-exclude-regexp`, which is referenced by `org-roam-file-p`, is probably a better option than `org-roam-db-node-include-function`, which is referenced by `org-roam-db-node-p`. It’s missing from the manual at the moment. Including the full path to the subdirectory in the regular expression should work:

```lisp
(setq org-roam-file-exclude-regexp
      (concat "^" (expand-file-name org-roam-directory) "/exclude-this-subdir/")

```
