A ferriporphyrin-based porous organic framework (Fe-PPOF) was successfully synthesized via the Sonogashira coupling reaction. By reason of high surface area, extended π-conjugation skeleton and excellent stability, Fe-PPOF can efficiently immobilize aptamers to fabricate an electrochemical aptasensor for detecting ultra-trace oxytetracycline (OTC) with the low limitation of detection of 2.05 fg·mL−1. Meanwhile, this biosensor exhibits high selectivity, good stability and available reproducibility. More importantly, the Fe-PPOF-based electrochemical aptasensor can quantitatively detect OTC in real samples.