Moving bed biofilm reactor (MBBR) system has a successful operation in the treatment of different types of wastewater. Since the media, i.e. the place of growth and formation of biofilm, play the main role in the treatment in this system, MBBR systems were operated in the present research with modified Bee-cell media. Activated carbon granules of almond or walnut shells were placed in media pores to improve the treatment of refinery oil wastewater and their operation with MBBR system was compared with the conventional Bee-cell media. In these experiments, the effects of organic loading rate, hydraulic retention time (HRT), media filling ratio (MFR), and activated carbon concentration (ACC) used in the media were investigated on the operation of MBBR systems. The analysis of results estimated the optimal values of HRT, MFR, and ACC used in the media between the studied levels, being equal to 22 h, 50%, and 7.5 g/L, respectively. Under these conditions, total petroleum hydrocarbons removal efficiencies for MBBR systems using Bee-cell media with carbon of almond, carbon of walnut shells, and a carbon-free system were 95 ± 1.17%, 91 ± 1.11%, and 57 ± 1.7%, respectively, which confirms the adsorption ability of systems with the media containing activated carbon in the removal of petroleum compounds from wastewater.