The short lesson on how to clean carpet stains that are acidic is this: act fast!
Battery acids, in particular, can cause serious damage to carpet. So can the acids found in some tile-cleaning compounds, drain cleaners and other household products.
As soon as you see the spill (which means before it is a stain if possible), get water and flush the area.
Extract the water (blot it up with white cotton cloth or un-dyed paper towles, or use a shop-vac), then flush the area again. Repeat the process several times. How quickly you move to clean these types of carpet stains is crucial to success. You need to wash away and dilute the acid before it damages the carpet.
Neutralize Acidic Carpet Stains
After cleaning the carpet with water, prepare a solution of one tablespoon baking soda mixed with a quart of warm water. Apply this to the area with a sponge or cloth. This will neutralize any remaining acid. Then you can rinse the area again, extract the water, and dry the carpet quickly.
Leave a fan blowing on it if you can. It always helps to dry carpet quickly after any clean-up. This prevents any remaining stain deeper down in the fibers from migrating up to the surface or visible parts.