Knots bleeding through painted wood are caused by tannin or resin. Found in softwoods such as cedar or redwood, tannins help the wood resist rot, but they also pose a problem for painters and homeowners. Tannin stains are triggered by moisture. Either the wood was damp when it was installed, or moisture later caused tannins to leach to the surface. In either case, they are quite easy to seal.
Remove resin residue by scraping and washing with trisodium phosphate (TSP) or multi-purpose detergent. Allow it to dry thoroughly.
Sand the wood lightly with 120- or 180-grit sandpaper. Wipe it clean with a damp rag.
Prime the knots with tinted shellac or oil-based primer. If there are just a few knots to seal, use an aerosol spray can of primer. Allow it to dry according to label directions. Most fast-dry oil or shellac primers can be top-coated within an hour.
Paint the wood with two coats of alkyd or latex paint, allowing 4 to 8 hours of drying time between coats.