Soil and aquatic pollution by heavy metal (Pb, Cr, Cu, Fe, Zn, and Ni) ions has become one of the prime problems worldwide. Thus, the purpose of the current study is to conduct hydrogeological research and quantify the main trace metals in the edible vegetables, soil, irrigation water, pesticides, and fertilizers in the farmland near Jeddah city, Saudi Arabia. Samples of soil, water, and plants such as coriander (Coriandrum sativum), dill (Anethum graveolens), parsley (Petroselinum crispum), and arugula (Eruca sativa) were collected, acid-digested, and analyzed using an inductively coupled plasma–optical emission spectrometer (ICP–OES). The levels of the elements in soil were determined in the order of Fe > Zn > Cu > Cr > Ni > Pb, whereas the sequence in plants was Fe > Cr > Zn > Pb> Ni > Cu, and in water, the order was Pb > Fe > Cu > Zn> Ni = Cr. In soil, the levels of Fe, Cr, and Pb were higher than the recommended values set by the World Health Organization (WHO) and the Food Administration Organization (FAO). In soil, Pb and Zn uptake increased with an increase in the availability of both elements, whereas in plants, Zn and Pb uptake occurs primarily through the plant roots, and some specific proteins facilitate metal transport and movement across the membrane. In soil, the root cell walls first bind to metal ions, which are taken up across the plasma membrane. The levels of the investigated elements in water and vegetables samples were below the permissible limits set by the FAO and within the allowable limits in the available pesticides and fertilizers. The transfer factor (TF) of metal absorption from soil to plant (TFsoil-plant) and from irrigated water to plant (TFwater-plant) in the study area was determined, followed by correlation and statistical treatment according to the date. The TF values were used to assess the metal levels in collected plant, soil, and water samples. The computed values of TF implied that plant leaves and soil were safe from the risk of heavy metals. Water irrigation causes heavy metal accumulation in soil and vegetables, with varying concentrations. The results of this study revealed no abnormal metal accumulation due to irrigation and no health risks to consumers.