The gummy thing you are talking about should be TPP oxide which is usually a byproduct in a reaction involving TPP. TPP oxide is very polar (than the product) due to which its solubility in non-polar solvents is less. The product could be dissolved in non-polar solvents such as ether or hexane or EtOAc:Hexane (5:95) depending on its polarity, leaving behind the byproduct.
If this method does not work then concentrate the reaction mixture, suspend the mass in pentane/hexane/ether and filter over a silica plug. The compound could be collected with the eluent leaving most of the TPP oxide on the silica bed.
Triphenylphoshine from a gummy product by strirring it with n-hexane , the impurity will become soluble in hexane & the crystalline compd. will come out.Another way you can stirr the gummary product with little dry methanol when solid separates out.
Bye-products formed in some reactions may prove difficult to remove, as in case of (may be) Wittig reaction you applied, It is better to use Chromatography.for purification
or, change reagents
•Change the reaction or the reagent to get less troublesome bye-products
and follow Horner-Emmons reaction which produces phosphonate salt (water soluble)
The above suggestions are good and you can follow any one of those. I suggest you to wash the gummy mixture repeatedly in n-hexane, benzene and diethyl ether.You might end up with a free flowing solid. As TPP and TPO both are soluble in Et2O and hexane, the resultant solid can be free from these.
After this - acid treatment, to convert Cadogan reaction products to ionic form (not suitable for pyrroles). Next step is sublimation of TPP/TPPO, or recrystallization/chromatography/extraction by low-polar solvents
Try filtration through a small pad of silica and elute with hexane. TPP will come out first and then elute your compound with a more polar solvent mixture.