Ever notice how dingy a white appliance or extension cord can look after a while? All cords get this dirty, regardless of color. Unplug the cord. Moisten a cloth with a solution of water and a non-abrasive all-purpose cleaning liquid, hold it in one hand and, with the other hand, simply pull the cord through the cloth several times. Caution: Don't use a cleaner containing alcohol or other solvents. Solvents can dry out the vinyl insulation and eventually cause it to crack.
Want to avoid twisted and tangled vacuum cleaner cords? Unplug the cord from the wall socket. Starting at the vacuum, pull the cord to you, coiling it loosely in one hand. As you pull, the free end with the plug will uncoil and untwist, leaving a neatly coiled cord for the next use.
As a general safety rule, never route electrical cords underneath carpets or heavy objects, such as furniture legs. The cord can overheat and cause a fire.
Reference:
Don Aslett in The Cleaning Encyclopedia: Your A to Z Illustrated Guide to Cleaning Like the Pros.