Pichia pastoris is a popular yeast host for high-level heterologous expression of proteins on an industrial scale owing to its reliable expression, robust growth, high fermentation density, and easy genetic manipulation and cultivation at a relatively low cost. Of particular interest is its high secretion efficiency for small proteins including insulin, human serum albumin, vaccines, enzymes, and llama-derived heavy-chain only antibodies (nanobodies) for pharmaceutical and research applications. However, a recurring challenge in using P. pastoris heterologous secretory proteins is the co-purification of a sticky, yellow pigment which has been identified as a tetra-benzoyl disaccharide. Current methods for pigment removal involve crystallization of the heterologous secretory protein, active carbon absorption, and chromatography using cation exchange and hydrophobic interaction. Here, we present a simple and effective method to remove the yellow pigment, demonstrated with divalent nanobodies targeting SARS-CoV-2. The method entails capturing the nanobody on an affinity column and subsequent washing with the zwitterionic detergent lauryldimethylamine N-oxide (LDAO). We anticipate the method become generally useful to remove pigments from secretion proteins produced in P. pastoris, offering a practical solution to enhance the purity of heterologous proteins in various biotechnological applications.