Removing the messages is easy - just click the "Delete All" button. Keeping them from coming back is another matter. The only way (aside from getting a bigger license) is to reduce the amount of data you ingest each day to below your license limit. Look for the most common sources and sourcetypes as they are probably sending the most data. Windows event logs and Linux audit logs tend to be very verbose as can performance metrics. Turn off the performance data you don't need and increase the interval between the metrics you do need. Consider filtering out unneeded events/audit.
Many thanks for the answer, I'm trying to disable the performance data I do not need and increase the interval between the metrics I need, but I can not find a configuration menu where I can do it. Could you please help me by telling me where I am doing these tasks?
The exact steps depend on what metrics you collect and how you collect them. For example, the Splunk Add-on for Unix and Linux has a setup screen where you can choose the metrics that are collected and how often.
Depending on the complexity of your environment, you may be able to edit input.conf files (be sure to put your changes in the local directories) to disable unneeded data.
The simplest way is to disable inputs you don't need.
Review any wildcarded inputs to make sure they're not including too many files.