Contact Form 7 is a plugin for WordPress that allows website visitors to contact website owners. It is one of the most popular WordPress plugins with over 5 million active installations.
Different methods can be used to prevent spam messages from being sent through Contact 7 Forms. We need to first think about how spam is sent though the Contact 7 forms.
Spam may be sent by an automated script or bot. This type of spam can be stopped using captcha. Fortunately Contact Form 7 has built in support for captcha. It allows users to easily insert captcha in forms
Another source of spam is human visitors that send junk email for different reasons. This type of spam may be stopped with the akismet configuration that is provided by Contact Form 7
See the article 6 Ways to Stop Contact Form 7 Spam in WordPress – Updated for 2018 for more information on how to prevent spam messages with Contact Form 7