Toilet bowl cleaner creates two problems for your carpet. The first problem is that its main disinfecting ingredient, sodium hypochlorite, is bleach, which can rob your carpet of color. The second problem is caused by the blue colorant, which is a dye called Acid Blue 9 or Brilliant Blue FCF. This dye has a complex molecular structure consisting of atoms of carbon, hydrogen, oxygen, nitrogen, sodium and sulfur. Despite its complexity, you can break it down and remove it with detergent or vinegar. Because of the bleach, though, the spot may remain noticeable.
Blot up as much of the stain as possible with an absorbent cloth. When the area is dry, use a vacuum to remove dried particles and crystals.
Prepare a solution consisting of 1/4-teaspoon mild dish detergent and 1 cup of warm water. Alternatively, mix 2 tablespoons of white vinegar in 4 cups of warm water. If either of these mixtures doesn't work, try the other.
Moisten a cloth with the cleaning solution and apply it to the stain. Allow it to remain for 5 minutes; then blot it off with a second clean cloth. Avoid rubbing the solution on the carpet -- you could damage it.
Repeat the cleaning process if you can still see the stain. Continue until none of the blue color from the dye transfers onto the blotting cloth.
Cover the previously stained area with paper towels to absorb moisture, weight them down with a glass or ceramic weight, and leave them overnight. Vacuum the carpet in the morning to restore its texture.