We investigate the impact of the diffuse ionized gas (DIG) on abundance determinations in star-forming (SF) galaxies. The DIG is characterised using the H$alpha$ equivalent width ($W_{text{H}alpha}$). From a set of 1,409 SF galaxies from the Mapping Nearby Galaxies at APO (MaNGA) survey, we calculate the fractional contribution of the DIG to several emission lines using high-$S/N$ data from SF spaxels (instead of using noisy emission-lines in DIG-dominated spaxels). Our method is applicable to spectra with observed $W_{text{H}alpha} gtrsim 10$ angstroms (which are not dominated by DIG emission). Since the DIG contribution depends on galactocentric distance, we provide DIG-correction formulae for both entire galaxies and single aperture spectra. Applying those to a sample of $,> 90,000$ SF galaxies from the Sloan Digital Sky Survey, we find the following. (1) The effect of the DIG on strong-line abundances depends on the index used. It is negligible for the ([O III]/H$beta$)/([N II]/H$alpha$) index, but reaches $sim 0.1$ dex at the high-metallicity end for [N II]/H$alpha$. (2) This result is based on the $sim$kpc MaNGA resolution, so the real effect of the DIG is likely greater. (3) We revisit the mass-metallicity-star formation rate (SFR) relation by correcting for the DIG contribution in both abundances and SFR. The effect of DIG removal is more prominent at higher stellar masses. Using the [N II]/H$alpha$ index, O/H increases with SFR at high stellar mass, contrary to previous claims.