Use code STATCH for an additional 10% off! 💥

Bulk update WooCommerce Measurement Price Calculator settings

Recently I was tasked with adding around 180 products to a WooCommerce store that uses the WooCommerce Measurement Price Calculator plugin. I quickly found out it’s impossible to globally update the settings. You have to go into each product, find the right tab in the metabox and update the settings accordingly.

Of course, I turned to the internet to find a solution that would help me bulk update—but there wasn’t really anything useful. However, I did find this in their documentation:

You can import and export products with measurement settings with the WooCommerce Product CSV Suite, but creating new measurement products via import is not really possible. The measurement data is stored as serialized meta, so while exporting and then re-importing existing products works just fine, creating new measurement products via an import is not ideal. New products should be configured in the WooCommerce admin.

Bummer! I needed a solution ASAP, you know project deadlines and stuff

So, I turned to jQuery to set up all the settings per product that I needed. This was perfect, because I still needed to go into every single product anyway to update photos and such.

So, I created a script that initialises on the product edit page, inputs the settinngs, and when the product gets updated those values will be saved in the database. If you have specific settings that are different per product, this will probably not work and you still need to do a bit of manual work . However, you can still update the settings that are the same on every product and save a lot of time.

function bulk_update_woo_measurement_price_calc(){
    jQuery(document).ready(function($) {
        function bulk_edit_woo_price_measurement() {
            $('select[name="_measurement_price_calculator"]  option[value="area"]').prop("selected", true );
            $("#_measurement_area_pricing").prop("checked", true);
            $("#_measurement_area_pricing_calculator_enabled").prop("checked", true);
            $('input[name="_measurement_area_label"]').val("Voer benodigde vierkante meters in:");

        if ($("").length > 0) {
add_action( 'admin_print_scripts', 'bulk_update_woo_measurement_price_calc', 999 );
Scroll to Top