Human–elephant conflict (HEC) contributes to the increasing death of Asian elephants due to road accidents, retaliatory killings and fatal infections from being trapped in snares. Understanding the diet of elephants throughout Peninsular Malaysia remains crucial to improve their habitat quality and reduce scenarios of HEC. DNA metabarcoding allows investigating the diet of animals without direct observation, especially in risky conflict areas. The aim of this study was to determine: i) the diet of wild Asian elephants from HEC areas in Peninsular Malaysia using DNA metabarcoding and ii) the influence of distinct environmental parameters at HEC locations on their feeding patterns. DNA was extracted from 39 faecal samples and pooled into 12 groups representing the different sample locations: Kuala Koh, Kenyir, Ulu Muda, Sira Batu, Kupang-Grik, Bumbun Tahan, Belum-Temengor, Grik, Kampung Pagi, Kampung Kuala Balah, Aring 10 and the National Elephant Conservation Centre, which served as a positive control for this study. DNA amplification and sequencing targeted the ribulose-bisphosphate carboxylase gene using the next-generation sequencing Illumina iSeq100 platform. Overall, we identified 35 orders, 88 families, 196 genera and 237 species of plants in the diet of the Asian elephants at HEC hotspots. Ficus (Moraceae), Curcuma (Zingiberaceae), Phoenix (Arecaceae), Maackia (Fabaceae), Garcinia (Clusiaceae) and Dichapetalum (Dichapetalaceae) were the highly abundant dietary plants. The plants successfully identified in this study could be used by the Department of Wildlife and National Parks (PERHILITAN) to create buffer zones by planting the recommended dietary plants around HEC locations and trails of elephants within Central Forest Spine (CFS) landscape.