The glycosyltransferase Ogt adds O-linked N-Acetylglucosamine (O-GlcNAc) moieties to nuclear and cytosolic proteins. Drosophila embryos lacking Ogt protein arrest development with a remarkably specific Polycomb phenotype, arising from the failure to repress Polycomb target genes. The Polycomb protein Polyhomeotic (Ph), an Ogt substrate, forms large aggregates in the absence of O-GlcNAcylation both in vivo and in vitro. O-GlcNAcylation of a serine/threonine (S/T) stretch in Ph is critical to prevent nonproductive aggregation of both Drosophila and human Ph via their C-terminal sterile alpha motif (SAM) domains in vitro. Full Ph repressor activity in vivo requires both the SAM domain and O-GlcNAcylation of the S/T stretch. We demonstrate that Ph mutants lacking the S/T stretch reproduce the phenotype of ogt mutants, suggesting that the S/T stretch in Ph is the key Ogt substrate in Drosophila. We propose that O-GlcNAcylation is needed for Ph to form functional, ordered assemblies via its SAM domain.