Since understanding the healthy status of gastrointestinal tract (GI tract) is of vital importance, clinical implementation for GI tract-related disease have attracted much more attention along with the rapid development of modern medicine. Here, a multifunctional theranostic system combining X-rays/CT/photothermal/photoacoustic mapping of GI tract and imaging-guided photothermal anti-bacterial treatment is designed and constructed. PEGylated W18O49 nanosheets (PEG-W18O49) are created via a facile solvothermal method and an in situ probe-sonication approach. In terms of excellent colloidal stability, low cytotoxicity, and neglectable hemolysis of PEG-W18O49, we demonstrate the first example of high-performance four-modal imaging of GI tract by using these nanosheets as contrast agents. More importantly, due to their intrinsic absorption of NIR light, glutaraldehyde-modified PEG-W18O49 are successfully applied as fault-free targeted photothermal agents for imaging-guided killing of bacteria on a mouse infection model. Critical to pre-clinical and clinical prospects, long-term toxicity is further investigated after oral administration of these theranostic agents. These kinds of tungsten-based nanomaterials exhibit great potential as multi-modal contrast agents for directed visualization of GI tract and anti-bacterial agents for phothothermal sterilization.