HONG KONG—A government test indicated that nearly half the rice sold in the southern Chinese city of Guangzhou was contaminated with cadmium, triggering anger from consumers that China's staple food hasn't escaped the widespread pollution tainting its air, water and soil.

Nearly half of 18 rice samples tested in local markets during the first three months of the year contained excessive levels of cadmium, according to the Guangzhou Food and Drug Administration. A carcinogenic metal that can wreak havoc on the body's kidneys,...