The following references from a few major rope manufacturers cover rope care thoroughly. Please see the bottom of this answer for a summary.
From Bluewater Ropes:
Avoid stepping on your rope. Beside the potential of cutting, stepping on a rope will grind dirt into the core and increase the possibility of internal abrasion.
Protect your rope from exposure to harsh chemicals. Do not allow your rope to come into contact with any compounds containing acids, alkalis, oxidizing agents or bleaching compounds. Be especially careful to avoid contact with battery acid or fumes. To help protect a rope from coming into contact with unidentified chemicals, always store and transport it in a rope bag.
Testing done indicates salt water, acetone, benzene, chloroform, freon, gasoline, kerosene, motor oil, mineral oil, paints and pine oil do not appreciably affect nylon and should not damage your rope. Laboratory tests performed have shown no appreciable damage done to nylon fibers by contact with insect repellents containing DEET (Test #0559).
Keep your rope clean. Dirt can shorten the life of your rope by increasing internal and external abrasion. It is a good idea to occasionally wash a rope to remove dirt and rock crystals. Put the rope in a pillowcase or washing bag and use a front loading machine with cold water only to prevent shrinkage. It is acceptable to use a mild soap to remove oil or grease but avoid harsh detergents. DO NOT USE BLEACH OR BLEACH SUBSTITUTES. Make sure to rinse thoroughly. Small amounts of fabric softener may be used to give better flexibility and a softer hand as a rope stiffens with use. Your rope should be air dried away from direct sunlight. It will not harm a rope to store it wet. Nylon is not affected by water and will not rot or mildew.
From Sterling Rope:
- What chemicals are bad for my rope?
It is best to assume that all chemicals are bad for your rope. Do not expose your nylon or polyester
ropes to chemicals. That said, much recent data has been collected regarding how substances affect
rope life. Data available from Honeywell Corporation (makers of nylon 6, polyester and Spectra®)
shows that nylon’s strength is not greatly affected by motor oil, mineral oil, salt water, Freon, gasoline,
kerosene, benzene, chloroform, paints, pine oils, or insect repellents containing DEET. Chemicals that
should be avoided at all costs are bleach and sulfuric acid. Still even with this reassurance it is best to
protect your rope from any exposure to any acids or alkalis and to store your rope in a cool dry environment.
From the UIAA:
Notification Concerning the Marking of Ropes
Tests done by the UIAA Safety Commission and some rope manufacturers have shown that marking ropes with liquids such as those provided by felt-tipped pens can damage them; even with those markers, sold specifically for marking ropes. The test results have shown a decrease of up to 50% of the rope strength, more correctly: of the energy absorption capacity of the rope (expressed by the number of falls in the standard test method in accordance with the UIAA Standard101).
Therefore the UIAA Safety Commission warns against marking a rope with any substance that has not been specifically approved by the rope manufacturer of that rope.
Also from the UIAA:
Conclusion: If you want to survive whilst climbing and mountaineering, please do not fall so that your rope comes tight over a sharp rock edge, and do not touch the rope with any acid!
See also the guide from Mammut.
Another reference that is too lengthy is from Black Diamond. It discusses the effect of urine on rope strength, which is surprisingly quite bad. (This article is no longer available, however this article references the preliminary testing done by Black Diamond.)
Avoid these things:
- Sharp edges, especially under load
- Acids & Alkalis Sulfuric acid, or battery acid, being a primary concern. Also urine, which contains uric acid among other things, is notably damaging, but only with extended exposure.
- Bleach & other oxidizing agents
- Extended UV exposure
- Solvent-based markers or pens
- Ground-in dirt or rock dust Keep rope as clean as possible and as is practical, and wash it appropriately when needed.
- Letting wet rope freeze Temporarily weakens the rope while frozen, but may be unavoidable for ice climbers in certain conditions.
- High heat This one's probably obvious, but nylon, comprising all dynamic ropes, will melt at 428°F (220°C). So campfire, stove, oven, dryer,... with high friction (nylon to nylon is really bad) being the most likely source to damage your rope.
To answer the question about hand sanitizer and sunscreen: There seems to be no specific testing of these substances on climbing rope. Use your judgement, but I see no reason to think that hand sanitizer or sunscreen would pose any threat to rope if it does not contain any of the above-mentioned damaging substances. Hand-sanitizer typically contains alcohol, moisturizers, and fragrance. Sunscreen typically contains a UV-inhibiter like titanium dioxide or zinc oxide, moisturizers, and fragrance. None of these substances is listed as harmful to nylon or climbing rope by rope manufactures or the UIAA.