Guinea pigs are sensitive to the strong smell of onions, and it can cause them to close their eyes.
Onions contain sulfur compounds that irritate the mucous membranes in the eyes and nose. This irritation can cause tearing and lead guinea pigs to close their eyes or move away from the odor.
It is important to remember that onions are toxic to guinea pigs and should never be fed to them. Keep onions away from their living space. If irritation persists, contact your veterinarian.