Subsoil alkalinity is a common issue in the alluvial cotton-growing valleys of northern New South Wales (NSW), Australia. Soil alkalinity can cause nutrient deficiencies and toxic effects, and inhibit rooting depth, which can have a detrimental impact on crop production. The depth at which a soil constraint is reached is important information for land managers, but it is difficult to measure or predict spatially. This study predicted the depth in which a pH (H2O) constraint (>9) was reached to a 1-cm vertical resolution to a 100-cm depth, on a 1070-hectare dryland cropping farm. Equal-area quadratic smoothing splines were used to resample vertical soil profile data, and a random forest (RF) model was used to produce the depth-to-soil pH constraint map. The RF model was accurate, with a Lin’s Concordance Correlation Coefficient (LCCC) of 0.63–0.66, and a Root Mean Square Error (RMSE) of 0.47–0.51 when testing with leave-one-site-out cross-validation. Approximately 77% of the farm was found to be constrained by a strongly alkaline pH greater than 9 (H2O) somewhere within the top 100 cm of the soil profile. The relationship between the predicted depth-to-soil pH constraint map and cotton and grain (wheat, canola, and chickpea) yield monitor data was analyzed for individual fields. Results showed that yield increased when a soil pH constraint was deeper in the profile, with a good relationship for wheat, canola, and chickpea, and a weaker relationship for cotton. The overall results from this study suggest that the modelling approach is valuable in identifying the depth-to-soil pH constraint, and could be adopted for other important subsoil constraints, such as sodicity. The outputs are also a promising opportunity to understand crop yield variability, which could lead to improvements in management practices.