Proper plant nutrition plays a crucial role in enhancing the quality and quantity of agricultural products. Phosphorus, a vital nutritional element, is often in short supply, severely limiting plant growth. The growing population and the consequent demand for more food have led farmers to use phosphorus-based fertilizers to boost production. However, this practice results in an excess of phosphorus entering agricultural drains and contaminating groundwater sources. To address this issue, the use of biological reactors for treating agricultural drainage water and removing elements like phosphorus has been explored. In this study, wheat straw and stubble were chosen as the substrate and content of the bioreactor due to their cost-effectiveness and widespread availability across Iran. Three galvanized iron boxes, each 1 m in length, width, and height, were used to simulate farm conditions. Each box was equipped with an outlet and an inlet for injecting drainage water and three points for collecting wastewater. The collection points were set at depths of 1, 6 and 16 cm from the bottom of the box. The boxes were filled with compacted wheat stubble up to a height of 20 cm from the floor, weighing 39 kg. The study was conducted over 51 days with four replications, using an effluent containing approximately 14 mg of phosphate per liter. All measurements were taken on-site using a 7100 photometer. The results showed that phosphate concentration decreased over time, with a minimum reduction of 48% and a maximum reduction of 97%, indicating the bioreactor’s satisfactory performance. Statistical tests such as the t-test and variance test revealed no difference in the reduction of element concentration (bioreactor performance) after 51 days of wheat straw and stubble life. The initial concentration was neutralized in this research due to the potential impact of temperature and initial concentration on the results. A covariance test was conducted to investigate the effect of temperature on the lifespan of straw and stubble, which showed no significant impact of temperature.