When we are saving any frontend form, it is showing the success message on same page and also on all other pages.

It also shows the messages after reload.

1 Answer 1


Your frontend controller save execute method success massage code should like this.

try {
    $this->messageManager->addSuccess(__('The testimonial has been saved.'));
    if ($this->getRequest()->getParam('back')) {
        $this->_redirect('*/*/edit', array('testimonial_id' => $model->getId(), '_current' => true));
} catch (\Magento\Framework\Model\Exception $e) {
} catch (\RuntimeException $e) {
} catch (\Exception $e) {
    $this->messageManager->addException($e, __('Something went wrong while saving the testimonial.'));

$this->_redirect('*/*/edit', array('testimonial_id' => $this->getRequest()->getParam('testimonial_id')));

Hope this will help, I have also save my custom module testimonial data from frontend and I didn't get repeated success message.

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.