For canonical asparagine glycosylation, the primary amino acid sequence that directs glycosylation at specific asparagine residues is well-established. Here we reveal that a recently discovered bacterial enzyme EarP, that transfers rhamnose to a specific arginine residue in its acceptor protein EF-P, specifically recognizes a beta-hairpin loop. Notably, while the in vitro rhamnosyltransferase activity of EarP is abolished when presented with linear substrate peptide sequences derived from EF-P, the enzyme readily glycosylates the same sequence in a cyclized beta-hairpin mimic. Additional studies with other substrate-mimicking cyclic peptides revealed that EarP activity is sensitive to the method used to induce cyclization and in some cases is tolerant to amino acid sequence variation. Using detailed NMR approaches, we established that the active peptide substrates all share some degree of beta-hairpin formation, and therefore conclude that the beta-hairpin epitope is the major determinant of arginine-rhamnosylation by EarP. Our findings add a novel recognition motif to the existing knowledge on substrate specificity of protein glycosylation, and are expected to guide future identifications of rhamnosylation sites in other protein substrates.