In order to protect your Joomla application from unwanted messages, you can use the Akismet component for Joomla.
This component is based on the Automattic Kismet (Akismet) project, which is dedicated to fighting spam.
The component is installed as any other Joomla component. Once you install Akismet for Joomla, you can configure it from your Joomla admin area > Components > Akismet.