Due to the significance of self‐healing coatings in recent years, there has been increasing desire to optimize process parameters for effective control of functions of the coatings for durable application. Among various approaches for achieving desired optimized properties, the use of central composite design (CCD) of the response surface methodology (RSM) remains an effective and reliable technique. Thus, the objective of this study was to develop an appropriate model for optimization of size of microcapsule to be used in synthesis of maleic anhydride‐based microcapsules for self‐healing function in defective epoxy coating. In this regard, a model was generated to estimate the effect of two process parameters (stirring speed and reaction time at constant temperature). The average size of microcapsules obtained experimentally (24.46 μm) was closely comparable to 25.27 μm obtained by the theoretical technique. Microcapsules were prepared based on these optimized size of microcapsule and the synthesized microcapsules were characterized. Also, effectiveness of these microcapsules in coatings was characterized by studying their adhesion performance, self‐healing functions under salt spray corrosion test, and anti‐corrosion by use of electrochemical impedance spectroscopy (EIS). Successful self‐healing function has been demonstrated by reason of anti‐corrosion effectiveness of maleic anhydride‐filled microcapsules.