MK WC Download URL Migrator
Safely bulk-rewrite the URLs of WooCommerce downloadable files (e.g. migrate dl/dl2/dl3 sub-domains to a single "download" host) in paced background batches, without breaking existing customer orders.
by Matin Khamooshi · github.com/matinkhamooshi/wc-download-url-migrator
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/matinkhamooshi/wc-download-url-migrator/archive/refs/heads/master.zipContributors: Matin Khamooshi
Author URI: https://matinkhamooshi.ir
Requires PHP: 7.4
WC requires at least: 6.0
Safely bulk-rewrite the URLs of WooCommerce downloadable files (e.g. migrate dl/dl2/dl3 sub-domains to a single "download" host) in paced background batches, without breaking existing customer orders.
Description
This plugin lets you change part of every WooCommerce downloadable file URL across your whole catalog and have customers keep downloading from the new URLs after the change.
Why orders stay intact:
WooCommerce stores downloadable files in the product meta _downloadable_files, an array keyed by a download_id (md5 hash). Customer download grants in the woocommerce_downloadable_product_permissions table reference that download_id, NOT the URL. This plugin rewrites only the file URL value and never changes the download_id key, so every existing permission keeps resolving — customers simply receive the new URL on their next download. The plugin never writes to any order or permission table.
Features:
- Flexible search & replace — host-aware (recommended), plain text, or regex rules.
- Quick setup to merge several sub-domains (dl, dl2, dl3) into one (download).
- Covers both simple products and product variations.
- Dry-run preview with before/after samples and impact counts.
- Background processing via WooCommerce Action Scheduler with configurable batch size and pause between batches to avoid 503 / gateway timeouts.
- Per-product backup and one-click batched rollback.
- Full change log (custom table) with product, before and after URLs.
Installation
- Upload the
wc-download-url-migratorfolder to/wp-content/plugins/. - Activate it from the Plugins screen.
- Go to WooCommerce → Download URL Migrator.
Usage
- In "Quick setup", enter source sub-domains (e.g.
dl, dl2, dl3), the target (download) and your base domain (site.com), then click "Generate rules". Or build rules manually in the table. - Set "Products per batch" (10–25 is safe) and "Pause between batches".
- Click "Preview (dry run)" to see how many products/files will change and sample before/after URLs.
- Click "Run migration". Progress updates live; the job runs in the background even if you close the page.
- If anything looks wrong, use "Roll back this run" to restore the original URLs.
Frequently Asked Questions
Will customers lose access to their purchased downloads?
No. Only the URL is changed; the internal download_id that permissions point to is preserved.
What if my server is slow / shared hosting?
Lower the batch size and increase the pause. The work is spread over time by Action Scheduler.
Does it support HPOS (custom order tables)?
Yes — it declares compatibility and never touches order tables.