This study presents the importance of urban field soils for producing vegetable crops. This study was conducted in the three local areas of Isfahan (first region), Falavarjan (second region), and Natanz, Feridan, and Golpayegan (third region) to evaluate transfer factor (TF), contamination factor, ecological risk (Er) and potential ecological risk index (RI) which were employed to investigate the Pb, Cu, Co, Cd, and Cr pollution of the urban field soils affecting vegetable to reveal the potential hazards of HMs pollution for the first time in Isfahan city in Iran. To measure the pollution of such heavy metals (HMs) as Pb, Cu, Co, Cd, and Cr, the related soil samples were collected and their pollution and ecological risk indices were assessed. The results showed the highest pollution of Pb and Cr in the field soils of the first (127.37 and 112.65 mg kg −1) and second (6.94 and 4.61 mg kg −1) regions, respectively, which were greater than the amounts recommended by Iran's Environmental Protection Agency. The high TF of Cr (0.56 mg kg −1), Cd (0.23 mg kg −1), and Co (0.30 mg kg −1) from the soils to the tubers were found to mostly involve leafy and fruity vegetables. The highest contamination factor (PF) of Cr (12.46 mg kg −1) in the first region was in the class of very high pollution. The highest Er of Cd in first and second regions was 264.0 and 214.9 mg kg −1 , respectively, which were considered in the high-risk class. These indices revealed possible increases in potential ecological RI in the mentioned regions (up to 330.8 and 272.4 mg kg −1 , respectively), which were classified in the classes of high and moderate pollution risk. Principal component analysis indicated that the pollution of the HMs in Isfahan and Falavarjan was overlapped. Cr in PC1 and Cd and Co in PC2 had the highest distributions and impacts representing enhancing transfer factor from the soils to onions, potatoes, and basil.