The incorporation of a versatile and tuneable polymer–peptide network into the pores of porous silicon photonic crystals improves the selectivity of porous silicon optical biosensors to detect certain types of matrix metalloproteinase enzymes.