Coal and organic-rich mudstone develop massive nanopores, which control the storage of adsorbed and free gas, as well as fluid flows. Generation and retention of bitumen and hydrocarbons of oil window reservoirs add more uncertainty to the nanoporosity. Solvent extraction is a traditional way to regain unobstructed pore networks but may cause additional effects due to interactions with rocks, such as solvent adsorbing on clay surfaces or absorbing in kerogens. Selected marine-continental coal and mudstone in Eastern Ordos Basin were studied to investigate how pore structures are affected by these in-situ-sorptive compounds (namely residual bitumen and hydrocarbons) and altered by solvent extractions. Solvent extraction was performed to obtain bitumen-free subsamples. Organic petrology, bulk geochemical analyses and gas chromatography were used to characterize the samples and the extracts. Low-pressure argon and carbon dioxide adsorptions were utilized to characterize the nanopore structures of the samples before and after extraction. The samples, both coal and mudstone, are in oil windows, with vitrinite reflectance ranging from 0.807 to 1.135%. The coals are strongly affected by marine organic input, except for the sample C-4; the mudstones are sourced by either marine or terrestrial organic input, or their mixture. As for the coals affected by marine organic input, residual bitumen and hydrocarbons occupying or blocking pores <10 nm becomes weak with thermal maturation. Bitumen derived from terrestrial organic matter mainly affects small pores, since coal asphaltene molecules are much smaller than petroleum asphaltene molecules. The mudstone M-2 with high extract production showed an increase of nanopores after extraction, due to the exposure of the filled or blocked pores. However, most transitional mudstones saw decreases of the pores because pore shrinkage caused by solvents adsorbing on and swelling clay minerals (mainly kaolinite and illite/smectite mixed layers) counteracts the released pore spaces. Solvent extractions on the coals significantly increased the micropores <0.6 nm, since the heat of sorption of alkanes reaches the peak in the pores within 0.4–0.5 nm. By contrast, solvent extractions on the mudstones decreased the micropores ∼0.35 nm, which is perhaps caused by evaporative drying of solvent displacing residual water in clay.