How To Remove Sale Price In Woocommerce

How to Remove Sale Price in WooCommerce: A Beginner’s Guide

So, you’ve got a WooCommerce store and a sale that’s come to an end (or maybe you never wanted to show those sale prices in the first place!). Now you’re stuck staring at those crossed-out prices and want them *gone*. Don’t worry, you’re in the right place! Removing the sale price from your WooCommerce store is a common task, and we’ll guide you through several easy methods to achieve it.

This guide is written for beginners, so we’ll keep the technical jargon to a minimum and focus on practical, straightforward solutions. We’ll cover a variety of ways to remove those sale prices, from simple plugin solutions to a little bit of code (don’t be scared, it’s easier than it looks!).

Why Remove Sale Prices?

Before we dive in, let’s briefly understand why you might want to do this. Consider these scenarios:

    • The Sale is Over: The most obvious reason! Running a sale is a great way to boost sales, but once it ends, you want to revert to the original pricing to avoid confusing customers. Imagine running a “Summer Sale” and it’s now December!
    • Consistent Branding: Sometimes, you might prefer a cleaner look. Perhaps you’re going for a minimalist design, or you simply don’t like the visual clutter of crossed-out prices.
    • Avoiding Confusion: Regularly running sales can actually devalue your products in the eyes of customers. They might start expecting everything to be discounted. Removing the sale price helps maintain the perceived value.
    • Promotional Strategy Changes: Maybe you’re shifting your focus from discounts to other marketing tactics like free shipping or bundles.

    Method 1: Using a WooCommerce Plugin (Easiest)

    The easiest and often recommended way to remove sale prices is by using a dedicated WooCommerce plugin. These plugins usually provide a user-friendly interface with options to control how sale prices are displayed (or not displayed!).

    Example:

    Let’s say you’re running a small online boutique selling handmade jewelry. You decided to have a “Valentine’s Day” sale, offering 20% off all necklaces. Now that Valentine’s Day is over, it’s time to remove the sale price indicators.

    Here’s how you might do it using a plugin (specific steps may vary depending on the plugin, but the general principle is the same):

    1. Install and Activate a Plugin: Search for a plugin like “WooCommerce Hide Sale Price,” “YITH WooCommerce Badge Management” (this offers more than just price hiding!), or “Remove WooCommerce Sale Price.” Install and activate it.

    2. Configure the Plugin: Navigate to the plugin’s settings page (usually found under the WooCommerce or Settings menu).

    3. Disable Sale Price Display: Look for an option to either:

    • Hide the sale price.
    • Only show the regular price.
    • Remove the strikethrough (crossed-out) styling.

    4. Save Changes: Save the plugin settings, and clear your website’s cache (if you use a caching plugin).

    Why this is good:

    • No coding required: Super Read more about How To Set Up A Woocommerce Theme easy for beginners.
    • Quick implementation: Usually takes just a few minutes to set up.
    • Flexibility: Many plugins offer additional features like controlling sale badges and labels.

    Method 2: Using a Custom Code Snippet (For the Slightly More Adventurous)

    If you’re comfortable with a little bit of code, you can achieve the same results by adding a custom code snippet to your WordPress theme’s `functions.php` file or using a code snippets plugin. Always back up your website before making changes to your theme files!

    Example:

    Imagine you’re selling digital art prints. You decided to have a flash sale on a particular collection of prints. You want to remove the sale price from *just* those prints after the promotion ends. Using code gives you more granular control.

    Here’s a snippet that will remove the sale price display on your WooCommerce store:

     add_filter( 'woocommerce_get_price_html', 'remove_sale_price_html' ); function remove_sale_price_html( $price ) { $product = wc_get_product( get_the_ID() ); 

    if ( $product->is_on_sale() ) {

    $price = wc_price( $product->get_regular_price() );

    }

    return $price;

    }

    Explanation:

    • `add_filter( ‘woocommerce_get_price_html’, ‘remove_sale_price_html’ );`: This line tells WordPress to use our custom function `remove_sale_price_html` to modify how the price is displayed.
    • `function remove_sale_price_html( $price ) { … }`: This is our custom function that does the work.
    • `$product = wc_get_product( get_the_ID() );`: This gets the current product object.
    • `if ( $product->is_on_sale() ) { … }`: This checks if the product is currently on sale.
    • `$price = wc_price( $product->get_regular_price() );`: If the product is on sale, it sets the price to the regular price, effectively removing the sale price display. `wc_price()` is a WooCommerce function that formats the price correctly.
    • `return $price;`: This returns the modified (or unmodified) price HTML.

    Where to put the code:

    1. Theme’s `functions.php` file: Go to Appearance -> Theme Editor in your WordPress dashboard. Find the `functions.php` file for your active theme and add the code at the very bottom. Again, back up your theme first!

    2. Code Snippets Plugin: A safer and recommended alternative is to use a plugin like “Code Snippets.” This plugin allows you to add and manage code snippets without directly editing your theme files. This is much safer because if the code causes an error, it won’t break your entire website.

    Why this is good:

    • No extra plugin required: Keeps your site lean.
    • More control: Allows for more advanced customization.
    • Direct control: You directly manipulate the WooCommerce functionality.

    Important Considerations:

    • Caching: After adding the code, clear your website’s cache to see the changes.
    • Testing: Always test your changes on a staging environment before applying them to your live website.
    • Child Themes: If you’re modifying your theme files, it’s highly recommended to use a child theme. This prevents your changes from being overwritten when you update your parent theme.

    Method 3: CSS (Quick Fix, But Not Always Ideal)

    While not a “true” removal of the sale price, you can use CSS to visually hide the sale price element. This is a quick fix, but the underlying HTML is still there.

    Example:

    Let’s say you’re selling downloadable ebooks. You ran a weekend sale. Now it’s Monday, and you want the sale price *gone*, but you’re in a hurry.

    Here’s the CSS you can add to your theme’s stylesheet (Appearance -> Customize -> Additional CSS):

    .woocommerce div.product p.price del {

    display: none !important;

    }

    Explanation:

    • `.woocommerce div.product p.price del`: This CSS selector targets the `` element (the strikethrough element) within the product price.
    • `display: none !important;`: This hides the element. The `!important` tag ensures that this style overrides other conflicting styles.

    Why this is good:

    • Very quick and easy: No plugin or code editing required.
    • Simple to implement: Just paste the CSS into your theme customizer.

    Why this isn’t always ideal:

    • The code is still there: Screen readers might still read out the sale price. Search engines might still see it.
    • Not a true removal: The underlying HTML structure remains unchanged.

    Which Method Should You Choose?

    • For Beginners and Speed: Use a plugin. It’s the easiest and fastest option.
    • For More Control and No Extra Plugins: Use a custom code snippet in your `functions.php` file or using a code snippets plugin.
    • For a Quick Visual Fix (with Limitations): Use CSS.

Regardless of the method you choose, remember to test your changes thoroughly and back up your website before making any modifications. Removing the sale price from your WooCommerce store is a simple task that can significantly improve the user experience and maintain your brand’s image. Good luck!

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *