A smart material with switchable surface wettability is highly desired for the practical application in removing oil from oily wastewater. In this work, we developed a robust and simple method to functionalize various substrate materials, such as a melamine sponge and nonwoven textile, with switchable surface oil wettability at varied media with different pHs. The modification method involves oxidative self-polymerization of dopamine on the material surface and subsequently functionalizing with a block copolymer, namely poly(2-vinylpyridine-b-dimethylsiloxane) (P2VP-b-PDMS). The as-functionalized materials display stable and continuous switchable wettability. The materials switch their wettability by simply responding to aqueous pH, and the switch is achieved at room temperature and involves no organic solvent. The materials show excellent oil/water separation performance for different kinds of oils and exhibit durability in strong alkaline and corrosive solutions. This robust and simple chemical modification strategy reduces the production cost of smart materials with switchable wettability and thus would lead to their mass production and applications toward solving practical industrial problems.