Disubstituted five‐membered heterocycles (1,2,4‐triazole and 1,3,4 oxadiazole) were synthesized and investigated as inhibitors for signal transducer and activator of transcription 3 (STAT3) enzyme of breast cancer. 3‐(Benzylthio)‐5‐(4‐chlorobenzyl)‐4H‐1,2,4‐triazol‐4‐amine (12d) was found to be the most active among the synthesized compounds with a half‐maximal inhibitory concentration (IC50) value of 1.5 µM on MCF7 cells and was found to show a great inhibitory effect on the STAT3 enzyme. Compounds 9a,b,d,e,f, 11, and 12a,b,f,e show IC50 values in the range of 3–12 µM for the MCF7 cell line. Molecular modeling was used to investigate the biological results of the synthesized compounds.