Can your computer keyboard be washed in the dishwasher
Many people have suggested using a can of compressed air to clean a keyboard. That will get the dust out of it, which is a good thing, but it does little toward actually cleaning it. The coffee that was spilled on it, the sticky feeling of some keys as a consequence of being a little careless with a jelly doughnut, those will not be touched by compressed air.
To actually clean the keyboard, more drastic measures are necessary. You can indeed use the dishwasher, and it works. This applies to wired keyboards. I have never tried the dishwasher with a wireless keyboard, so I have no first-hand knowledge of the effects. It will clean it just fine but it might ruin it in the process, so beware. If you decide to try to clean your wireless keyboard in the dishwasher, remove the batteries first.
Disconnect the keyboard from the computer. I recommend removing the wire from it, because you do not want water to get in the cable. It takes a very long time to dry. Set the dishwasher on warm, not hot. No soap. I’ll say that again: no soap. Soap is great for dishes but you do not want it on the inside of your keyboard. Do not use the heating cycle to dry it, if you happen to have that option. Just remove it when the cycle is over, wipe off the outside moisture, and set it aside. It will take two or three days to dry thoroughly. I have done it several times and it works. It leaves your keyboard squeaky clean, inside and out. Some have suggested using a blow dryer or even the microwave to speed up the drying process. Stay away from the microwave. There is no telling what a large blast of microwave radiation might do to the inner workings of your keyboard. Probably nothing, but why take the chance? As for the blow dryer, it will probably make you think the keyboard is fully dry before all the moisture is gone. Just let it dry on its own. You do not want to apply power to a keyboard that is still a little wet. When people drop their cell phone in water, the first thing many of them do is turn it on to see if it still works. You might be able to regain at least some of its functions if you let it dry, but when you turn it on and apply power to the wet circuits, they get fried and your phone is ruined.
Cleaning the computer itself is a different matter. Do not put it in the dishwasher; that will kill it. You will have a clean, dead computer. The most basic cleaning is to open it up and use compressed air to clear out the dust. If you have to touch any parts inside it, wear gloves (plastic ones). This is to prevent damage due to static electricity. A very small dose can destroy a vital component.