Catalyzes the conversion of caffeic acid to ferulic acid and of 5-hydroxyferulic acid to sinapic acid. The resulting products may subsequently be converted to the corresponding alcohols that are incorporated into lignins. (E)-caffeate + S-adenosyl-L-methionine = (E)-ferulate + H(+) + S-adenosyl-L-homocysteine Aromatic compound metabolism; phenylpropanoid biosynthesis. Homodimer. Caffeic acid 3-O-methyltransferase (COMT) not only has distinct substrate specificity from (iso)eugenol O-methyltransferases (IEMT), a highly homologous enzyme, but it also methylates the hydroxyl group at the meta position rather than at the para position as IEMT does. Belongs to the class I-like SAM-binding methyltransferase superfamily. Cation-independent O-methyltransferase family. COMT subfamily.