Two anthraquinone-based polymers aiming at improving the capacity and voltage of magnesium ion batteries, were synthesized and characterized. The excellent battery cycling performance was demonstrated with the electrolyte consisting of magnesium bis(hexamethyldisilazide) and magnesium chloride.