Protein N-glycosylation is ubiquitously present in all domains of life, and confers a plethora of functions to the protein including increased solubility, protection from degradation, interaction with receptors, and activation for function. For canonical asparagine glycosylation, the recognition sequence that directs glycosylation at specific asparagine residues is well-established. It generally holds for protein glycosylation that the primary amino acid sequence is most important for substrate recognition. Here we reveal that a recently discovered bacterial enzyme called EarP, that transfers rhamnose to a specific arginine residue in its acceptor protein EF-P, specifically recognizes a β-hairpin loop. Notably, while the rhamnosyltransferase activity of EarP is abolished when presented with linear substrate peptide sequences derived from EF-P in vitro, the enzyme readily glycosylates the same sequence when presented in a cyclized β-hairpin mimic containing an l-Pro-d-Pro motif. 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 β-hairpin formation, and therefore conclude that the β-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 inform future identifications of rhamnosylation sites in other protein substrates.