I'm trying to reposition the messages in my Woocommerce theme. For example the successfully added to cart message. They appear to automatically be placed at the very top of where the woocommerce wrapper start begins.

I've already found this link which allows me to change the wording of the message but what I need is to remove the message from where it is and reposition it elsewhere.

I've scoured the woocommerce forum, this forum and the woocommerce template files. There is a messages.php but that only appears to contain the markup for the messages. I cannot figure out how to change where the messages appear. Any help on this would be greatly appreciated.

3 Answers 3


WooCommerce renders messages by using woocommerce_show_messages() function. This function is hooked to woocommerce_before_single_product action. So if you don't want to render messages before single product, you need to remove that hook for the action.

remove_action( 'woocommerce_before_single_product', 'woocommerce_show_messages' );

If you want to render messages in another place, then just call woocommerce_show_messages() function in desired place.

remove_action( 'woocommerce_before_single_product', 'woocommerce_show_messages' );
add_action( 'woocommerce_after_single_product', 'woocommerce_show_messages', 15 );

You can also add a 3rd parameter for positioning priority if needed.

Source Woo Hooks


Since 2.1.0 woocommerce_show_messages is a deprecated function. You should use wc_print_notices instead:

remove_action( 'woocommerce_before_single_product', 'wc_print_notices' );

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.