Update March 2019: We wanted to make this post even more useful, and therefore added a section that explains how to edit the price on variable and simple products. The price editor location is different for each product type, which can sometimes cause confusion. We have also read your comments and updated the code so that the price should no longer show zero. Let us know if you have any trouble!

Understanding how to change product prices in WooCommerce makes it possible for you to run your store competitively, improving your ROI.  As we’ll explain below, you can change individual products or run a bulk price change on variable products. But when you need to raise the base price of all your WooCommerce products, this can be a tedious task. That’s why we want to share this nifty code that we created to help.

How to Change the WooCommerce Price via Functions.php

Recently, we had had a project where we needed to show a discounted price on WooCommerce products without editing the price in the database of our WordPress install. Thanks to WooCommerce’s handy hooks, this was pretty simple. Here’s our code snippet.

function return_custom_price($price, $product) {
    global $post, $blog_id;
    $price = get_post_meta($post->ID, '_regular_price');
    $post_id = $post->ID;
    $price = ($price[0]*2.5);
    return $price;
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);

OR

function return_custom_price($price, $product) {
    global $post, $blog_id;
    $product = wc_get_product( $post_id );
    $post_id = $post->ID;
    $price = ($price*2.5);
    return $price;
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);



In this example, we needed to raise our base price by 2.5x, but you could use this to modify the price in almost anyway you'd like.

How to Add Custom Price to WooCommerce Products Without Coding

Normally, you can change product prices in WooCommerce without needing to add any codes. There are two places you’ll find the price editor, and its location depends on whether the product is simple or variable. 

Simple products have no variations. What you see is what you get. Variable products have some variations, such as different colors or sizes, and the price may change according to the variation.

Here’s how to change product prices in WooCommerce:

  • For both types of products, start from your dashboard and click on the “Products” navigation menu on the left hand side. From there, choose the product you want to edit. Scroll down to the WooCommerce Product Data section.
  • For simple products with a single variation, the price editor will be on the first tab.
  • For a WooCommerce variable product price change, click on the Variations tab. From there, you can either click on each individual variation to change to price, or use the bulk editor to do a bulk price increase for all variations.

Are you taking full advantage of WooCommerce to get the most out of your store? Check out our post on 5 Tips to Optimize Your WooCommerce Store Performance.

Have any other WooCommerce pricing tips or tricks to share? Leave a comment below. Want to hand off the maintenance of your WooCommerce store to an experienced team? Get in touch!