We report a novel approach for the preparation of multilayer polymers for protein and bacterial antifouling. Stainless steel (SS) was used as the model substrate. SS was first coated with a hybrid polymer film, which was formed by simultaneous hydrolytic polycondensation of 3‐aminopropyltriethoxysilane and polymerization of dopamine (HPAPD). Then p‐phenylenediamine was chemically bound to SS–HPAPD. The amino groups of p‐phenylenediamine were used as anchors for the growth of polyaniline nanofiber arrays by polymerization of aniline in situ. The nanofibers were further silicificated using 3‐aminopropyltriethoxysilane, 3‐mercaptopropyltriethoxysilane, vinyltrimethoxysilane and octyltrimethoxysilane, conferring various functional groups. The silicificated polyaniline nanofiber arrays (SPNAs) become hydrophobic. Separate tests for the adsorption of proteins of small (54 kDa) and large (2 × 90 kDa) molecular weights and Escherichia coli on the SPNAs were performed. The results show that the SPNAs can resist the adhesion of the proteins with an average efficiency of 96.3 ± 3.2%, and the SPNAs can resist the adhesion and colonization of Escherichia coli with an average efficiency of 97.5 ± 3.8%. The methodology of forming SPNAs on SS is of general utility and has wide application potential. © 2017 Society of Chemical Industry