In a house with kids, the ketchup bottle lid inevitably gets gross. I kept a lid from a previous bottle and ran it through the dishwasher. Now whenever the current bottles lid is too yucky, I switch out the lid. I clean the dirty one, then place it in the drawer for the next time I want to swap them. :)
This page contains the following solutions.
Condiment lids get really icky and need to be cleaned like most anything else does. My ickiest one is catsup! Every once in awhile, take off the cap and soak it a little while in water (I drop mine into a coffee cup that also needs soaked a bit) and the buildup comes off easy.