CO2 competitive sorption with shale gas under various conditions from simple to complex pore characteristics is studied using a molecular density functional theory (DFT) that reduces to perturbed chain-statistical associating fluid theory in the bulk fluid region. The DFT model is first verified by grand canonical Monte Carlo simulation in graphite slit pores for pure and binary component systems at different temperatures, pressures, pore sizes, and bulk gas compositions for methane/ethane with CO2. Then, the model is utilized in multicomponent systems that include CH4, C2H6, and C3+ components of different compositions. It is shown that the selectivity of CO2 decreases with increases in temperature, pressure, nanopore size, and average mol...