The heat transfer and flow resistance of magnetic fluid flow under a magnetic field in the absence and presence of porous media were investigated experimentally in a rectangular duct. A ceramic foam, with a pore density of 13PPI (pores per inch), was used as a porous media. The mainstream flow rate varied between 0.1 and 3.7 l/min, while the magnetic intensity was adjusted to 0, 100, 300, and 500 mT. The results showed heat transfer was enhanced in both the non-porous and porous ceramic by applying the magnetic field to the magnetic fluid flow. Under a magnetic intensity of 500 mT, the heat transfer increments in the absence and presence of the foam were approximately 16.8% and 15.3%, respectively. By applying a magnetic fluid flow through the foam, the maximum heat transfer increment reached 171.7% compared to the absence of foam at the same flow rate. Notably, combining the use of a magnetic field and the ceramic foam resulted in a synergetic enhancement in heat transfer at low flow rates. The magnetic fluid flowing through the foam had a substantially higher flow resistance than the non-foam magnetic fluid flow. The pressure drop increased by applying a magnetic field to the magnetic fluid in the absence and presence of foam. The performance of the combined heat transfer techniques was evaluated in this research based on a performance evaluation criterion value. The results revealed that by applying the magnetic field, the performance evaluation criterion value of the magnetic fluid flow in the presence of foam was higher than in the absence of foam. Finally, the predictive formulas for Nusselt number and performance evaluation criterion as a function of Magnetic fluid heat transfer number were proposed.