Query pages with zero backlinks

Hello! I’m struggling to query all pages with zero backlinks.

I’ve tried this, but it’s not working.

function getBacklinks(pageName) 
  return query[[
    from index.tag "link"
    where _.page != pageName and _.toPage == pageName
  ]]
end
${query[[
  from index.tag "page"
  where #getBacklinks(name) == 0
  select name
]]}

Can somebody help?

P.S. SilverBullet is awesome!

Is this what you’re looking for? List pages that have no links to them? (orphan pages)

1 Like

Thanks!