Website Building » WooCommerce » How to Edit WooCommerce Notices Wrapper?

How to Edit WooCommerce Notices Wrapper?

Last updated on October 1, 2022 @ 5:47 am

WooCommerce is a great eCommerce platform for WordPress. It’s easy to use and extremely versatile. However, one area where it falls short is in the area of notices.

By default, WooCommerce displays all notices in a very basic, plain format. This can be frustrating for store owners who want to style their notices to match their store’s branding.

Luckily, there is a way to edit the WooCommerce notices wrapper and style the text within it using HTML tags. In this article, we’ll walk you through the steps needed to do this.

First, you’ll need to access your WooCommerce files. You can do this via FTP or by using your hosting control panel’s file manager tool. Once you have access to your WooCommerce files, navigate to the /wp-content/plugins/woocommerce/ folder and open the file named class-wc-notices.php in a text editor.

Next, locate the following line of code:

$message = wpautop( wptexturize( $message ) );

This line is responsible for adding paragraph tags ( < p > ) around your notice text. We want to remove this so that we can add our own HTML tags. To do this, simply delete that line of code and save the file.

Now that we’ve removed the automatic paragraph tags, we can add our own HTML tags around our notice text. For example, let’s say we want to make our notice text bold and underlined . We would add the following code:

This would output our notice text as follows:

Your notice text here.

Of course, you can style your notice text however you like using any HTML tags you desire.

Conclusion: How to Edit WooCommerce Notices Wrapper? You can edit the WooCommerce notices wrapper by accessing your WooCommerce files via FTP or your hosting control panel’s file manager tool.

Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.