To prepare intelligent controllable oil/water separation materials with high mechanical stability and good recyclability, we fabricated a novel pH-controlled wettability melamine sponge by using a facile dip-coating method. The coated sponge exhibits reversibly switchable wettability between superhydrophilicity-superoleophobicity through acidic surrounding and superhydrophobicity-superoleophilicity under neutral or alkaline conditions. The as-prepared sponge possesses excellent absorption capacity (46.06-122.81 g/g) and oil/water separation efficiency (above 98%). The coated sponge also has good mechanical stability and recyclability which means it can be reused for absorption and oil/water separation. This smart porous material, which can flexibly transform wettability on demand, has great application prospects in oil/water separation.