I don't think you can remove the idea (phenotypical differences are obvious, and people always tend to assume they are superior to others), but it may be possible to make racism less influential if other ideas become (or remain) dominant. Frex, in the French Empire, racism always struggled for primacy with a cultural self-definition that, while no less exclusionary and discriminatory, allowed for greater mobility. Similar ideas existed elsewhere, too, though they tended to take more of a back seat. Strengthen such beliefs - e.g. through an unbroken strand of Enlightenment optimism or a stronger tradition of universal Christianity - and you could have a different world.