Knock down any old nests that are visible, and remove their traces by washing away the mud with water. Otherwise, swallows will tenaciously seek to return to old nests and rebuild them -- particularly during breeding season.
Physically block swallows from forming nests by covering any part of a building suitable for nesting with netting. You must secure netting before swallows start forming their nests, using hooks or staples.
Install permanent projectors of wire or plastic along building surfaces, both vertically and horizontally. The spiky surface may make landing uncomfortable for the birds, and may discourage nesting.
Cover any rough surfaces, which are preferred by the birds for nesting, with smooth material such as glass or fiberglass. These surfaces make it difficult for the birds to find secure footing or a stable attachment for their nest, so they will go elsewhere.