The simultaneous mitigation of toxic arsenic (As) and cadmium (Cd) in rice grain remains a global challenge. The over-accumulation of husk dimethylarsinic acid (DMAs) induces the rice straight-head disease, which threatens rice production worldwide. In this study, we investigated various soil ridge height treatments with Eh ranging from − 225–87 mV and pH ranging from 6.3 to 4.1. Soil ridge cultivation can maintain grain As and Cd at low levels for slightly co-contaminated paddy soils, especially when the ridge height is 11 cm (Eh of 43 mV and pH of 4.6), where grain inorganic As decreased—at maximum—by 48% and DMAs by 55%. Grain Cd (0.14 mg kg−1) increased but was still below the limit (0.2 mg kg−1) in China, and the cost of ridging is acceptable. There were definite correlations among porewater As, Cd, Fe, S, and Mn contents across various Eh and pH values. Soil ridge cultivation significantly (P < 0.05) diminished the copy number of As-reducing (harboring arsC and arrA), As-methylating (harboring arsM), and sulfate-reducing (harboring dsrA) bacteria. Moreover, soil ridge cultivation shifted the arsM-harboring microbiota. In response to ridge height increase, the abundance of the bacterial biomarker phylum Euryachaeota declined and the families Halorubrum and Planctomyces were gradually replaced by Sandaracinus in paddy soil.