Bolting, or going to seed, is the plant's natural living process. This can often be brought on prematurely by warm weather and longer days.
In the case of a pepper plant bolting, there is not anything you can do as a gardener to stop the process. Harsh as it is, I would pull them up.
I would try getting some new plants. Keep them well watered and fed.