Mg(II)bisporphyrin has been used as an efficient host for the selective binding of guest ligands. In the presence of heterogeneous guest pairs, 2-aminopyrimidine/pyrazine and 2-aminopyrimidine/1,4-dioxane, 2-aminopyrimidine is bound selectively inside the bisporphyrin cavity whereas pyrazine/1,4-dioxane is bound outside to produce 1D mixed ligand polymers. UV-vis, (1)H NMR spectra and X-ray structure confirm such a selective and orthogonal binding of the guest ligands. The mixed ligand polymer has been synthesized just by mixing the host and guests in one pot and easily isolated as a solid in nearly quantitative yield due to its high stability.