Also I tried searching for a solution on this forum but it turns out that 'bibliography' is a common word and cannot be searched for

(begin irrelevant motivations for strange request)
I am writing a thesis which has a single master thesis.bib file, and a main thesis.tex file which uses the 'subfiles' package to include the chapterXX.tex files. The idea is that each subfile is individually compilable; I have got the graphics working and I have also got the references working IF each chapter has a \bibliography command at the bottom. I have a command in the main file to kill these commands so they don't do anything when the main file is compiled; there is never more than 1 active \bibliography command.
The problem is that this produces a 'chapter' bibliography at the end of each chapter if I compile it on its own, which I don't want. If I don't include the \bibliography command then obvious the citations don't work (since no \begin{thebibliography} and \bibitem commands are generated).
(end motivations)
So the question is - how do you get bibtex to do the citations, generate the bibliography, and then prevent it from printing? I thought about hiding it in a \phantom, but I assume this would create a blank page, and I tried various things that in retrospect won't work like changing \begin{thebibliography} in the .bst file to \begin{comment} (with the aid of the verbatim package).