# Links with Org-IDs are not showing up in backlinks

**URL:** <https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939>\
**Category:** Troubleshooting\
**Created:** [November 6, 2020, 10:51am UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939 "2020-11-06T10:51:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [November 6, 2020, 10:51am UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939/1 "2020-11-06T10:51:46Z")

</div>

If I use org-roam with org-ids, all backlinks to headings do not show up (it works fine without using `ord-id` ). I’ve added this to my .emacs:

`(setq org-id-link-to-org-use-id 'create-if-interactive-and-no-custom-id)`

If, however, I use `org-roam-insert` to link to the file with the headings, all links with org-ids also show up in the backlinks. It appears that somehow the database is not updated. Is there anything I can do to fix this behaviour? For reasons of long-term preservability I am strongly preferring the use of org-ids. Thank a lot.

---

<div class="post-metadata">

**Author:** ![cool\_ran](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/cool_ran/32/130_2.png) [@cool\_ran](https://org-roam.discourse.group/u/cool_ran)\
**Post date:** [November 6, 2020, 7:48pm UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939/2 "2020-11-06T19:48:30Z")

</div>

I have no problem with showing backlink using `org-id` type of link.

```
#+TITLE: testing example A
#+CREATED: [2020-11-06 Fri 14:30]
#+LAST_MODIFIED: [2020-11-06 Fri 14:33]

* headline 1
  :PROPERTIES:
  :ID: uuid-a
  :END:

* headline 2
  :PROPERTIES:
  :ID: uuid-b
  :END:

```

In another file B like this:

```
#+TITLE: testing example B
#+CREATED: [2020-11-06 Fri 14:32]
#+LAST_MODIFIED: [2020-11-06 Fri 14:33]

I link a [[id:uuid-b][file]]

```

If I am in file A, I can see a backlink pointing to file B.

---

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [November 6, 2020, 8:49pm UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939/3 "2020-11-06T20:49:59Z")

</div>

Thanks for the reply. If the backlinks with `org-id` show up, they work fine for me as well. My issue is that the database is somehow not updated when I use `org-store-link` and `org-id` is active. For what it is worth, I even did a `org-roam-db-clear` & `org-roam-db-built-cache` and they would still not show up in the backlinks. Only if I use `org-roam-insert` to the file which contains the headline, the database is finally updated and they show up. They remain there even if I remove the link afterwards - so that is a workaround, but still not a good solution.

Offtopic: how do you create the #+created: & #+last\_modified ?

---

<div class="post-metadata">

**Author:** ![cool\_ran](https://yyz2.discourse-cdn.com/free1/user_avatar/org-roam.discourse.group/cool_ran/32/130_2.png) [@cool\_ran](https://org-roam.discourse.group/u/cool_ran)\
**Post date:** [November 7, 2020, 2:48am UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939/4 "2020-11-07T02:48:41Z")

</div>

I am not sure how you manipulate org-mode file exactly.

On my side, if I:

1. `(org-id-copy)` under an org entry
2. mark any string in any org-roam note
3. link this string with id:UUID
4. save file

Then, if I go back to the file that has a entry being linked. I now  
can see the back link without any delay.

* * *

The time stamp is stolen from Leo Vivier [https://github.com/zaeph/.emacs.d/blob/4548c34d1965f4732d5df1f56134dc36b58f6577/init.el#L2822-L2875](https://github.com/zaeph/.emacs.d/blob/4548c34d1965f4732d5df1f56134dc36b58f6577/init.el#L2822-L2875)

---

<div class="post-metadata">

**Author:** ![laotang](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@laotang](https://org-roam.discourse.group/u/laotang)\
**Post date:** [November 7, 2020, 8:46pm UTC](https://org-roam.discourse.group/t/links-with-org-ids-are-not-showing-up-in-backlinks/939/5 "2020-11-07T20:46:03Z")

</div>

My bad. I missed the crucial part, action no. 4. Without saving it could not work. Great way to start here 🙂

I’ve added this to my .emacs to avoid the issue:

```
(defun save-after-link-store ()
  (interactive)
  (call-interactively 'org-store-link)
  (save-buffer))
(global-set-key (kbd "C-c l") 'save-after-link-store)

(define-key org-mode-map (kbd "C-c C-l") nil)
(defun save-after-insert-link ()
  (interactive)
  (call-interactively 'org-insert-link)
  (save-buffer))
(global-set-key (kbd "C-c C-l") 'save-after-insert-link)

```

It works great, so far.

ps Thanks also for the link to the time stamp code. I haven’t figured out how to get that to work but that is something for another day.
