Herein, we reported 36 novel nifuroxazide derivatives based on 4 or 5‐nitropyrrole skeleton for the first time. The influence of the benzyl substituents on the pyrrole ring and/or hydroxyl substituent on the benzene ring for the anticancer activity was investigated. Most of the designed derivatives were active at micromolar or submicromolar concentrations. The most promising compounds, namely derivatives (E)‐2,3‐dihydroxy‐N′‐((5‐nitro‐1‐(4‐(trifluoromethyl)benzyl)‐1H‐pyrrol‐2‐yl)methylene) benzohydrazide (18), (E)‐N′‐((1‐(4‐fluorobenzyl)‐5‐nitro‐1H‐pyrrol‐2‐yl) methylene)‐2,3‐dihydroxybenzohydrazide (24), and (E)‐N′‐((1‐(3‐fluorobenzyl)‐5‐nitro‐1H‐pyrrol‐2‐yl) methylene)‐2,3‐dihydroxybenzohydrazide (30), exhibited better antitumor activity than nifuroxazide in vitro, with IC50 values ranging from 0.80 to 5.18 μM on CNE2 (human nasopharyngeal carcinoma cell line) and SUNE1 (human nasopharyngeal carcinoma cell line). Docking results indicated that compounds 24 and 30 interacted with the SRC homology 2 (SH2) and carboxyl‐terminal transactivation domain of STAT3 (the signal transducer and activator of transcription 3), with binding energies ranging from −3.98 to −3.88 kcal/mol, and exhibited similar binding modes and energies to nifuroxazide. Interestingly, the trifluoromethyl substituted 18 interacts in the coiled‐coil, DNA‐binding and linker domain of STAT3, with a binding energy of −4.16 kcal/mol.