Herein, porphyrin-based COF was covalently grown on the surface of the desired metal organic framework. The prepared composite was physically accommodated on the pores of HF for HF-SPME approach followed by high-performance liquid chromatography-ultraviolet detection (HPLC-UV). Under the optimum condition, the linear range of the method for diazinon and chlorpyrifos were estimated in the range of 1–500 μg.L−1 and 0.5–200 μg.L−1 (r2 > 0.9969). The detection limit of the method for diazinon was equal to 0.19 µg.L−1 and for chlorpyrifos it was equal to 0.14 µg.L−1. The limits of quantification of the method were also calculated for two analytes equal to 0.63 and 0.47 µg.L−1, respectively. The intra-day and inter-day relative standard deviations (RSDs%) were calculated to be in the range of 1.1–5.2 %. The Enrichment Factors (EFs) were also obtained 102 and 134. The HF-SPME-HPLC-UV was effectively employed to quantify the trace concentration of diazinon and chlorpyrifos in tomato, orange, strawberry, apple and grape with acceptable recoveries (90–101 %) and RSDs less than 3.8 %. The results showed the success of the method in extracting these analytes from the target samples.