List All Backlinks Not Referenced in the Current Note

Hello everyone,

The issue I’m facing has already been discussed in these two threads:

I’m trying to create a list of all backlinks to my current note that are NOT already referenced in the note itself. While I’ve used the Dataview table solution suggested in one of the threads, my vault has grown so large that this approach has become very slow and laggy, everytime i open a note:

LIST WITHOUT ID inlink 
FLATTEN this.file.inlinks as inlink 
WHERE file = this.file 
AND !contains(this.file.outlinks, inlink) 
SORT inlink.name ASC

Does anyone know of an alternative solution or plugin that could handle this more efficiently?

Thanks in advance for your help!

Please do switch line two and three of that query, that would have a dramatic impact on the effectiveness of it! I can’t believe I’ve suggested the other way around…

```dataview 
LIST WITHOUT ID inlink 
WHERE file = this.file 
FLATTEN this.file.inlinks as inlink 
WHERE !contains(this.file.outlinks, inlink) 
SORT inlink.name ASC
```
2 Likes

Thank you :heart_eyes:. It’s completely smooth now.

However, the next problem is: How do I update the code at the bottom of approximately 1,000 notes? :joy:

I think the easiest and safest option is to use VS Code editor, and do an exact search-and-replace on the two lines you need to switch.

Either that, or do a search and replace to switch out the entire query with a reference to something like dv.view("dvscripts/footer.js"), and move the entire query (and other footer related stuff) to that script… This do require a little more editing though, but could be valuable in the long run.

1 Like

Here’s another way to show backlinks with missing links in the note…

```dataview
LIST
FROM [[]] and !outgoing([[]])
SORT file.name ASC
```
2 Likes

Worked perfectly fine. Thank you :heart_eyes: