How to clear message queue generated from drupal set message when ajax api popup windows are open in Drupal?
Drupal 5-8: running drupal_get_messages () will clear the messages.
8.5.x has a new Messenger service that you can use. The drupal_get_messages() function will be deprecated.
drupal_get_messages()
Delete all messages using the Messenger service:
$messages = \Drupal::messenger()->deleteAll();
Drupal 7:
Messages are in $ _SESSION, if you want, for example, clearing "status" -Messages, you can do it like this:
if (isset($_SESSION['messages']['status'])) { unset($_SESSION['messages']['status']); }