Silk fabrics treated with gallic acid/pyrrole (PGA/PPy) complexes polymerised using horseradish peroxidase have higher electrochemical activity than silk fabrics dyed with gallic acid alone. However, the degree of polymerisation decreases. As a result, the ultraviolet (UV) protection and fastness of the silk fabric were lowered. To solve this problem, we studied the degree of polymerisation of the complex and the functionality of dyed silk fabrics by applying a polyethylene glycol (PEG) template to the enzymatic polymerisation of PGA/PPy. The polymerisation mechanism of the complexes was analysed in detail using UV‐visible spectroscopy, Fourier‐transform infrared (FTIR) spectroscopy, and high‐performance liquid chromatography electrospray ionisation mass spectrometry (HPLC‐ESI‐MS). Consequently, the PGA/PPy/PEG complex has a higher degree of polymerisation than the PGA/PPy prepared without PEG, indicating that the PEG template can promote the polymerisation of PGA and PPy. As a result, we found that the presence of the PEG template improved the thermal stability and UV protection function of the dyed silk fabric, but did not impair the electrochemical activity of silk fabric. As a result of analysing the colour depth, it exhibited a higher K/S value compared to the dyed silk fabric in the absence of PEG. Additionally, its colour fastness was improved.