I have some QGIS projects that I've been using for long time, adding and removing layers, updating reference to deleted or moved files etc.
Opening the qgs file with a text editor I see that it contains numerous references to different files, and this references are not showed on the Layer tree pane.
I have three different cases: references to existing file, references to missing files, references to database connections. I got aware of this when I opened my project on another machine, and QGIS reported a missing database connection to vector tables not present in the layer tree view.
Manually deleting references from the qgs file solved the problem, but I'm managing huge projects and it's near to impossible to manually check the project consistency. I've tried the "Remove empty layers" plugin, but the ones I'm trying to remove are not empty layers.
Is there any way to 'purge' qgis file?