Automatically delete all links to a deleted page

As far as I see, when a page is deleted, the existing [[links]] to that deleted page still exist in other pages.
Can someone please confirm that this is the case?
Thanks

This is normal behavior, and it makes perfect sense for it to be so. However, it can also make sense in specific cases as I imagine is the case.

Considering that when you delete a page your in effect telling the system you don’t care about that keyword it should give you the option to remove links else the page will keep returning.

I’n my use case I usually merge the page to something else that’s more fitting to get rid of a keyword, but if you really do need to get rid of a word you could use something like sed or vscode to do a find replace for [[pagename]] and replace with pagename.

Example on how I use sed to remove example page links and replace with just the text, I run this in pages and journals directory.

sed -i 's/\[\[example page\]\]/example page/g' *
2 Likes

Considering that when you delete a page your in effect telling the system you don’t care about that keyword it should give you the option to remove links else the page will keep returning.

In my opinion, when I tell the system to delete a page, I’m just telling the system to delete that page, and that’s exactly what I want. No more no less.

However, I do think that it can be useful to have the option to unlink the links that point to a given page when you are about to delete it. Although that would already be a feature request.

Regarding regex, maybe it would be good to have a list of the most common cases, maybe in the form of a form, in the configuration form, for example, talking about feature requests

Is there a way to do this while using Sync? If I edit the files on my local drive the files are overwritten when Logseq next syncs.

I have managed to create a linked page for [[To]]. I use autolinker and have accumulated 400 linked pages for [[To]] that I want to get rid of.

That’s weird, I use sync and the pages should just be synced up.

Things I did to make it work

  1. Have logseq open and fully synced
  2. Run sed command
  3. See Logseq sync changes

Things that could possibly break this, if you close Logseq during the change it might think it is out of sync and restore things when you start it again.

If it doesn’t work at all, you can try the nuclear option, copy everything to separate dir, fix it without sync enabled and then sync it to a new name. (This is why I have Personal2 in my cloud sync).
It’s not pretty but will work.

Crossing fingers for that updated sync that’s promised for a while now.

1 Like

ah - I didn’t do this. I synced, closed logseq, then made the changes. I’ll retry and report back if it Doesn’t work!

Thanks