Sulfated motifs in heparan sulfate inhibit Streptococcus pneumoniae adhesion onto fibronectin and attenuate corneal infection. Here, FN1 is linked to corneal infection.