UbiA prenyltransferases (PTs) play an indispensable role in the prenylation of plant metabolites, yielding numerous natural products with enhanced pharmacological activities, such as cannabinoids, polycyclic polyprenylated acylphloroglucinols, prenylated flavonoids, and stilbenoids. These enzymes typically target specific carbon atoms or hydroxy groups of aromatic substrates. Despite the recent identification of dozens of plant-derived UbiA PTs, their catalytic mechanism remains poorly understood, particularly regarding the precise control of regioselectivity. In this study, we identified and characterized a total of 10 members that catalyzed the regioselective prenylation and geranylation of moracin substrates through comprehensive analysis of the UbiA superfamily in Morus alba. Molecular dockings, dynamics simulations, and quantum chemical calculations revealed the substrate-induced conformational changes leading to the formation of the hydrophobic reaction pocket, as well as the differential binding between various MaPTs and moracin M. Additionally, the recognition of prenyl donors by MaPT27 and the potential mechanism underlying the reversal of regioselectivity induced by different donors are discussed. Finally, structure-based rational mutation altered the site preference from C7 to C5. These findings suggest that the regioselectivity of plant UbiA PTs is governed by both the inherent chemoselectivity of reaction sites and intricate protein-substrate interactions.