What's the best way to alter or remove specific popup notification messages? I have a situation where the duplicate membership warning when creating a membership from the backend is not relevant for a client, and would like to suppress the warning so as not to confuse users or clutter the interface.

I've played with CRM_Core_Session::getStatus() but it doesn't appear to be aware of this notification (likely because it's triggered via the tpl file rather than PHP).

2 Answers 2


You are in the right path, if you look at the CRM_Core_Session class you'll see the method getStatus which takes a boolean as a parameter, if TRUEthen it will reset the status.

That said, I would create a extension or use an existing one and implement hook_civicrm_postProcess.

You'll need to know what is the class/form name of the form you are targeting, an easy way would be to inspect the source of the form/page from which you want to remove/replace the notification and search for .tpl

Example: CRM/Contact/Form/Task/Email.tpl, its class/form name would be CRM_Contact_Form_Task_Email

Then in your extension:

function myextension_civicrm_postProcess( $formName, &$form ) {
    if($formName == 'CRM_Contact_Form_Task_Email') {
        $session = CRM_Core_Session::singleton();
        // Reomve status message from form
        $session->getStatus( $reset = TRUE );
        // Set your new message
        $session::setStatus(ts('This is a custom message.'), ts('Custom Message'), 'success');

I don't think Civi has a setting to turn OFF the notification

But If you still need to turn Off the message or need to change the content of the message then you need to look for these files



you can override the files to your custom template folder and you can make changes or you can also disable the alert

I guess this helps !!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.