The chemical reactions and pathways involving pentachlorophenol, a chlorinated insecticide and fungicide used primarily to protect timber from fungal rot and wood boring insects. Pentachlorophenol is significantly toxic to mammals, plants, and many microorganisms.