(N, F) co-doped TiO2 was prepared by solvothermal method with urea as N source followed by surface fluorination, and then loaded onto a monolithic coal-based hierarchical porous carbon foam (HPCF). The activity of the synthesized (N, F)–TiO2/HPCF was compared with pure TiO2, N/F mono-doped TiO2 and the unloaded (N, F)–TiO2 for photocatalytic degradation of phenol. Furthermore, the effect of different pore structures of HPCFs on photocatalytic activity was investigated. The results showed that N doping extended the photoresponse of TiO2 to the visible region, while the lattice doping of fluorine greatly improved its UV-light driven activity. The macropores and thin-walled structure of HPCF ensured that the loaded TiO2 could be exposed to the light, and its micro/mesopores enhanced adsorption capacity. As a result, the (N, F) co-doped TiO2 supported on the HPCF with a larger mesoporosity of 21% and a specific surface area of 301.8 m2/g exhibited the highest photocatalytic activity and a stable cyclic usability under simulated sunlight irradiation. This study indicates great potential of the novel (N, F) co-doped TiO2/HPCF composite in photocatalysis for wastewater treatment.