The polypeptide GalNAc-transferases (GalNAc-Ts), that initiate mucin-type O-glycosylation, consist of a catalytic and a lectin domain connected by a flexible linker. In addition to recognizing polypeptide sequence, the GalNAc-Ts exhibit unique long-range N- A nd/or C-terminal prior glycosylation (GalNAc-O-Ser/Thr) preferences modulated by the lectin domain. Here we report studies on GalNAc-T4 that reveal the origins of its unique N-terminal long-range glycopeptide specificity, which is the opposite of GalNAc-T2. The GalNAc-T4 structure bound to a monoglycopeptide shows that the GalNAc-binding site of its lectin domain is rotated relative to the homologous GalNAc-T2 structure, explaining their different long-range preferences. Kinetics and molecular dynamics simulations on several GalNAc-T2 flexible linker constructs show altered remote prior glycosylation preferences, confirming that the flexible linker dictates the rotation of the lectin domain, thus modulating the GalNAc-Ts' long-range preferences. This work for the first time provides the structural basis for the different remote prior glycosylation preferences of the GalNAc-Ts.