Modulation of pore environment is an effective strategy to optimize guest binding in porous materials. We report the post-synthetic modification of the charge distribution in a charged metal-organic framework, MFM-305-CH3, [Al(OH)(L)]Cl, [(H2L)Cl = 3,5-dicarboxy-1-methylpyridinium chloride] and its effect on guest binding. MFM-305-CH3 shows a distribution of cationic (methylpyridinium) and anionic (chloride) centers and can be modified to release free pyridyl N-centres by thermal demethylation of the 1-methylpyridinium moiety to give the neutral isostructural MFM-305. This leads simultaneously to enhanced adsorption capacities and selectivities (two parameters that often change in opposite directions) for CO2 and SO2 in MFM-305. The host-guest binding has been comprehensively investigated by in situ synchrotron X-ray and neutron powder diffraction, inelastic neutron scattering, synchrotron infrared and 2H NMR spectroscopy and theoretical modelling to reveal the binding domains of CO2 and SO2 in these materials. CO2 and SO2 binding in MFM-305-CH3 is shown to occur via hydrogen bonding to the methyl and aromatic-CH groups, with a long range interaction to chloride for CO2. In MFM-305 the hydroxyl, pyridyl and aromatic C-H groups bind CO2 and SO2 more effectively via hydrogen bonds and dipole interactions. Post-synthetic modification via dealkylation of the as-synthesised metal-organic framework is a powerful route to the synthesis of materials incorporating active polar groups that cannot be prepared directly.