The prediction of water quality in urban rivers plays a crucial role in supporting water environment management. This study collected and organized realtime water quality monitoring data from four water quality monitoring stations in the Fenjiang River Basin of Foshan City, spanning from 2016 to 2021. To reduce noise interference in historical monitoring data, we applied a wavelet packet denoising (WPD) technique. Subsequently, we developed a single-factor water quality prediction model based on Long Short-Term Memory (LSTM), focusing on two key factors of water quality degradation: chemical oxygen demand (COD) and ammonia nitrogen (NH3-N).The results of this study demonstrate that the integration of WPD with LSTM, referred to as WPD-LSTM, outperformed conventional LSTM models in terms of predictive accuracy. Notably, the WPD-LSTM model exhibited superior performance in predicting the impact of COD and NH3-N on water quality in the Fenjiang River, surpassing the traditional LSTM model over a prediction period of 12 hours and 3 days.In the 12-hour prediction, the RMSE values of NH3-N predictions in the four monitoring sections decreased by 55% to 67%, with an average decrease of 61%; the RMSE values of COD predictions in the four monitoring sections decreased by 18% to 51%, with an average decrease of 29%. In the 3-day prediction, the RMSE values of NH3-N predictions in the four monitoring sections decreased by 40% to 83%, with an average decrease of 65%; the RMSE values of COD predictions in the four monitoring sections decreased by 50% to 69%, with an average decrease of 60%. By employing the WPD-LSTM method, this study contributes to improving the precision of water quality prediction, thereby providing valuable insights for effective water environment management in urban river systems.