Liquefaction has been responsible for several earthquake-related hazards in the past. An earthquake may cause liquefaction in saturated granular soils, which might lead to massive consequences. The ability to accurately anticipate soil liquefaction potential is thus critical, particularly in the context of civil engineering project planning. Support vector machines (SVMs) and Bayesian optimization (BO), a well-known optimization method, were used in this work to accurately forecast soil liquefaction potential. Before the development of the BOSVM model, an evolutionary random forest (ERF) model was used for input selection. From among the nine candidate inputs, the ERF selected six, including water table, effective vertical stress, peak acceleration at the ground surface, measured CPT tip resistance, cyclic stress ratio (CSR), and mean grain size, as the most important ones to predict the soil liquefaction. After the BOSVM model was developed using the six selected inputs, the performance of this model was evaluated using renowned performance criteria, including accuracy (%), receiver operating characteristic (ROC) curve, and area under the ROC curve (AUC). In addition, the performance of this model was compared with a standard SVM model and other machine learning models. The results of the BOSVM model showed that this model outperformed other models. The BOSVM model achieved an accuracy of 96.4% and 95.8% and an AUC of 0.93 and 0.98 for the training and testing phases, respectively. Our research suggests that BOSVM is a viable alternative to conventional soil liquefaction prediction methods. In addition, the findings of this research show that the BO method is successful in training the SVM model.