Porous carbons were prepared through carbonization of poly(ethylene terephthalate) contained in mixtures with either light basic magnesium carbonate, or magnesium carbonate, or magnesium hydroxide, or magnesium oxide. Pore structure of the obtained carbon materials was presented in relation to a kind of magnesium compound and weight ratio of the raw materials used for preparations. Additionally, an influence of the preparation temperature on the porosity and the pore creation mechanism are briefly discussed. The carbons obtained were tested as sorbent materials for elimination of model contaminants from water. For that purpose, removal of several pollutants of different molecular weights including phenol, Basic Red 18 dye, and Reactive Red 198 dye is presented and discussed in relation to the porosity of the prepared materials.