Links: XML structure element, not in layout
I've come across an issue where non-existent links appear in InDesign files that have been reused, i.e., when creating a series of branded documents. 'Go to Link' in the Links panel does nothing and, when you hover over the < > symbol beside the link, the tooltip says "XML structure element, not in layout". However, when you search the structure, they're impossible to find.
I've now discovered (by exporting XML and viewing in Xcode) that structure elements are not deleted when you delete content from a file so that explains the non-existent links – they're throwbacks to the content of the original file. Indeed, if you open the Structure panel and delete content, you'll see the Structure panel does not update.
So, how do you get rid of structure elements relating to the original file's content when there doesn't appear to be any way of identifing which elements are throwback and which are new? I've seen a fix that suggests untagging everything but that's too destructive to be a viable workaround.
Anyone got a workable fix? Is there no way to rebuild/repair the structure.