View Categories

Fix Conditional Shipping After Site Migration

Problem Description #

After migrating your site to a new domain (or moving from staging to live, or changing site URL), the Conditional Shipping plugin no longer applies your shipping rules, shipping options are unconditionally available or wrong shipping is shown.

Common symptoms:

  • Shipping restrictions that worked before migration no longer apply.

  • Customers get free shipping or restricted shipping by default, regardless of conditions.

  • No errors shown in admin — plugin appears active.

Cause:
Some site migrations involve changes in site URL, serialization issues in saved settings, or database entries tied to old URLs or domain-specific data (like shipping zones, city/country lists). Conditional Shipping may fail because settings reference old domain data (especially in payment‑gateway or city-based rules). This exact scenario appeared in the plugin support forum. WPFactory

Solution – step‑by‑step #

  1. Review plugin settings and re‑save them

    • Go to WPFactory → Conditional Shipping → Settings/Conditions.

    • Re-enter or re-select previously saved values (products, tags, cities, user roles, etc.). Sometimes options get invalidated after migration.

    • Save the settings again (even if unchanged) to rewrite data under new domain context.

  2. Flush permalinks and WooCommerce shipping zone cache (if any)

    • Go to Settings → Permalinks → click “Save Changes.”

    • If you use caching plugins or server caching, purge all caches (page cache, object cache, CDN).

  3. Test shipping behavior with fresh cart and address

    • Use a test order with conditions that should trigger restriction.

    • Test changing shipping address or product to verify plugin logic works.

  4. Check for serialization or serialized option entries

    • If your migration used a search/replacement tool (e.g., to replace old domain with new), make sure serialized data was handled correctly. Some tools corrupt serialized strings, leading to invalid plugin settings.

  5. If migration included changes in shipping zones or city/country codes, reconfigure zones

    • Sometimes shipping zone IDs or city names change when migrating or importing zones. Re‑select or re‑enter correct zones/cities in plugin condition settings.

  6. Contact support if still broken

    • Provide old domain, new domain, details of migration (DB export/import method), and screenshots of shipping condition settings. Plugin authors generally investigate attacks related to migration issues.

Prerequisites #

  • Admin & DB access (to re‑save settings, flush caches).

  • If site URL changed, ensure WP Address & Site Address settings updated correctly.

Additional Notes / Prevention #

  • Always use migration tools that handle serialized data correctly (e.g., WP‑CLI search-replace, WP Migrate DB, etc.).

  • After migration, revalidate all conditional settings in shipping plugins before going live.

 

Conditional Shipping for WooCommerce