A mesoporous silica was functionalized by carbon nanotubes to enhance the extraction performance. The mesoporous material was coated on stainless steel wires, and three wires were inserted inside of a polyetheretherketone tube for in‐tube solid‐phase microextraction. The tube was coupled to high‐performance liquid chromatography with diode array detection to obtain online analytical system, then its extraction performance was evaluated using eight polycyclic aromatic hydrocarbons as the targets. In order to good sensitivity and accuracy, four conditions were optimized such as sampling volume, sampling rate, methanol content in the sample, and desorption time. Under the optimum conditions, an online analytical method was established and exhibited low limits of detection from 0.005 to 0.050 µg/L, wide linear range of 0.016‐20.00 µg/L with acceptable correlation coefficients in 0.9921‐0.9999, as well as large enrichment factors in the range of 311‐2412. The method was successfully applied to determine trace polycyclic aromatic hydrocarbons in some real water samples including, two kinds of bottled water, tap water, and river water, a few polycyclic aromatic hydrocarbons were detected but none quantified in these samples.