Abstract. In situ soil pH measurements with ion-selective electrodes (ISEs) are receiving increasing attention in soil mapping for precision agriculture as they can avoid time-consuming sampling and off-site laboratory work. However, unlike the standard laboratory protocol, in situ pH measurements are carried out at lower and varying soil moisture contents (SMCs), which can have a pronounced effect on the sensor readings. In addition, as the contact with the soil during in situ measurements should be relatively short, effects of soil texture could be expected because texture controls the migration of protons to the electrode interface. This may be exacerbated by the fact that the electrodes used for in situ measurements are made of less sensitive but more robust materials as compared to the standard glass electrode. Therefore, the aim of the present study was to investigate the effect of soil moisture and soil texture on pH measurements using robust antimony and epoxy-body ISEs pressed directly into the soil for 30 s. The SMC was gradually increased from dry conditions to field capacity. A wide range of soil texture classes were included, with sand, silt, and clay contents ranging from 16 % to 91 %, 5 % to 44 %, and 4 % to 65 %, respectively. An exponential model was fitted to the data to quantify the relationship between SMC and pH. The results show that an increase in SMC causes a maximum increase in pH of approximately 1.5 pH units, regardless of the type of pH ISE used. Furthermore, for sandy soil textures, a rather linear relationship between pH and SMC was observed, whereas, with decreasing mean particle diameter (MPD), the model had a pronounced exponential shape, i.e., a greater pH increase at low SMC and a plateau effect at high SMC. With increasing SMC, the pH values asymptotically approached the standard pH measured with a glass electrode in 0.01 M CaCl2 (soil : solution ratio of 1:2.5). Thus, at high SMC, subsequent calibration of the sensor pH values to the standard pH value is negligible, which may be relevant for using the sensor pH data for lime requirement estimates. The pH measurement error decreases exponentially with increasing soil moisture and increases with decreasing MPD. Using a knee point detection, reliable pH values were obtained for SMC > 11 %, irrespective of the pH ISE used. An analysis of the regression coefficients of the fitted exponential model showed that the maximum pH increase also depends on soil texture; i.e., the influence of soil moisture variation on the pH value increases with decreasing MPD. Moreover, the concavity of the exponential curve increases with decreasing MPD.