So here's the top secret solution. Before recycling the empty ketchup bottle, save the cap and toss in the dishwasher. Are you ready for this? You now have an extra cap. So when your still half-full bottle of ketchup has a cap that's all nasty and crusty and gross, you can toss it into the dishwasher and twist on a fresh cap.
There is always a fresh cap waiting. It's like the circle of life. Like watching The Lion King and eating a hot-dog while solving math equations. Or something like that.