The structural, electronic and optical properties of transition metal doped porphyrin (TM@P; TM = Mn, Co, Fe, Cu, Ni, Zn) as well as the effect of CO adsorption on TM@P properties have been investigated using the density functional theory (DFT). The presented results include adsorption energies, bond lengths, electronic configurations, magnetic moments, density of states, frontier molecular orbitals, and UV-Vis. spectra. Our calculation results show that, the CO molecule favors to be adsorbed on TM-doped Porphyrin with its carbon head. The most energetically stable adsorption of CO is reported for Fe doped Porphyrin. The interaction between CO molecules with TM@P is attributed to donation-back donation as well as charge transfer mechanisms. Mn, Co and Fe-doped porphyrins have visible active nature which may be affected by CO adsorption, whereas, Ni, Cu and Zn-doped porphyrins have UV active nature which not affected by CO adsorption. These results may be meaningful for CO removal and detection.