This work reports on the synthesis, characterization, and photocatalytic performance of the TiO2 inverse opal nanostructure (IP-TiO2) and the IP-TiO2 modified by Ag nanoparticles (Ag@IP-TiO2). The IP-TiO2 is fabricated using polystyrene spheres as the template and TiCl4 as the precursor, and the Ag@IP-TiO2 is realized by photoreduction method. The morphological, structural, and optical properties of the materials are investigated by scanning electron microscopy, X-ray diffraction, ultraviolet–visible (UV-VIS) absorption spectroscopy, and photoluminescence spectroscopy. Their photocatalytic performances are studied by the degradation of rifampicin antibiotic under the visible-light irradiation generated by an LED lamp. The results demonstrate that the IP-TiO2 is composed of mesopores arranged in the honeycomb structure and strongly absorbs visible light in the wavelength range of 400–500 nm. This facilitates the visible-light catalytic activity of IP-TiO2, which is further enhanced by the surface modification by Ag nanoparticles. Our studies on the UV-VIS absorption and photoluminescent properties of the materials reveal that the presence of Ag nanoparticles not only enhances the visible-light absorption of IP-TiO2, but also reduces the recombination of photogenerated electrons and holes. These two factors create a synergic effect that causes the enhanced photocatalytic performance of Ag@IP-TiO2.