If you want to reset and restore the default shipping methods in WooCommerce after modifying or disabling them, follow these steps

Step 1: Remove Custom Code

  • Go to your theme’s functions.php file or your custom plugin.
  • Remove any code that filters or disables the WooCommerce shipping methods (including the previous custom shipping code).

Step 2: Reset Shipping Zones

  1. Navigate to WooCommerce > Settings > Shipping.
  2. Delete any custom shipping zones you may have added.
  3. Recreate new shipping zones and assign shipping methods such as:
    • Flat Rate
    • Free Shipping
    • Local Pickup

Step 3: Clear WooCommerce Cache

  1. Go to WooCommerce > Status > Tools.
  2. Clear these:
    • Clear WooCommerce Transients
    • Clear Expired Transients
    • Regenerate Shipping Zone Cache

Step 4: Test Default Shipping

  • Add a product to the cart.
  • Check the cart and checkout pages to ensure default shipping methods are back.

Optional: Debugging

If the default shipping methods are not appearing, enable debugging:

add_action('woocommerce_package_rates', function ($available_shipping_methods) {
    error_log(print_r($available_shipping_methods, true));
    return $available_shipping_methods;
});

Check the wp-content/debug.log file for any issues.

Would you like help setting up the default shipping zones again?

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x