Alkylphenols (APs) are nonionic surfactants with toxic and estrogenic properties. APs from municipal and industrial wastewater are frequently detected in surface waters. Therefore, a broadly accepted method for the treatment of APs is needed. The moving-bed bioreactor (MBBR) is an effective process for micropollutant elimination. In this study, the modeling of 4-nonylphenol (4-NP) and 4-tert-octylphenol (4-t-OP) removal from synthetic wastewater using MBBR was performed. Also, a comparison was made between the multilayer perceptron artificial neural network (MLPNN) trained with the traditional Levenberg Marquardt (LM) and the particle swarm optimization (PSO) algorithms. The performance of MBBR in removing chemical oxygen demand (COD) and APs was predicted using the COD surface area loading rate (SALR), COD volumetric loading rate (VLR), hydraulic retention time (HRT), and the initial concentration of APs. The results showed that the best transfer functions are Tan-sigmoid in the hidden layer and Purelin in the output layer. The number of optimal neurons was 5:9:3 for LM and 5:11:3 for PSO. Moreover, the network trained with PSO algorithm was slightly more predictive (R = 0.9997 MSE = 2.526e-5, MAE = 0.0041) than the traditional LM algorithm (R = 0.9989, MSE = 2.582e-5, MAE = 0.0043), especially by increasing the number of neurons. Finally, a sensitivity analysis was performed using ANN-PSO and Pearson correlation, and the results were completely compatible.