Urban agriculture is increasingly popular for social and economical benefits. However, edible crops grown in cities can be contaminated by airborne pollutants, thus leading to serious health risks. Therefore, we need a better understanding of contamination risks of urban cultivation to define safe practices. Here we study heavy metal risk in horticultural crops grown in urban gardens of Bologna, Italy. We investigated the effect of proximity to different pollution sources such as roads and railways, and the effect of the growing system used, that is soil versus soilless cultivation. We compared heavy metal concentration in urban and rural crops. We focused on surface deposition and tissue accumulation of pollutants during 3 years. Results show that in the city, crops near the road were polluted by heavy metals, with up to 160 mg per kilogram of dry weight for lettuce and 210 mg/kg for basil. The highest Cd accumulation of up to 1.2 mg/kg was found in rural tomato. Soilless planting systems enabled a reduction of heavy metal accumulation in plant tissue, of up to −71 % for rosemary leaves.