Nipple piercing

So i got my nipples piercied back in november and about a couple days ago they got really infected and i decided to take them out is that safe to do ?