Complete checklist and automation scripts for zero-downtime WordPress migrations with full SEO preservation.
Migrating a WordPress site without losing traffic, rankings, or functionality requires a systematic approach. This repository provides:
- Step-by-step checklists for pre- and post-migration phases
- PHP automation scripts for URL redirects, database search-replace, and health checks
- Client-ready report templates for professional delivery
- SEO preservation workflows to protect your search rankings
wordpress-migration-checklist/
├── checklists/
│ ├── pre-migration.md # Everything to do BEFORE you migrate
│ └── post-migration.md # Everything to verify AFTER migration
├── scripts/
│ ├── url-redirect-generator.php # Generate .htaccess rules from CSV
│ ├── search-replace-db.php # Safe serialization-aware DB search/replace
│ └── post-migration-health-check.php # Automated site health verification
├── templates/
│ └── migration-report.md # Client-facing migration report template
└── README.md
Work through checklists/pre-migration.md completely before touching any files or DNS settings. No step is optional.
php scripts/url-redirect-generator.php --input=redirects.csv --output=.htaccessCSV format:
old_url,new_url
/old-page/,/new-page/
/category/old/,/new-category/
# Always dry-run first
php scripts/search-replace-db.php --dry-run --from="http://old-domain.com" --to="https://new-domain.com"
# Then execute for real
php scripts/search-replace-db.php --from="http://old-domain.com" --to="https://new-domain.com"php scripts/post-migration-health-check.php --url="https://new-domain.com" --report=health-report.jsonWork through checklists/post-migration.md and deliver templates/migration-report.md to your client.
- Full site backup (files + database)
- Environment documentation
- SEO baseline capture
- Redirect planning
- DNS & SSL preparation
- Staging environment testing
- File transfer via SFTP/rsync
- Database export, transform, import
- Configuration updates (wp-config.php, .htaccess)
- DNS cutover procedure
- SSL verification
- Functional testing (pages, forms, payments, email)
- SEO verification (canonicals, sitemap, robots.txt)
- Performance baseline (Core Web Vitals)
- 30-day monitoring plan
- 1:1 URL mapping for all changed URLs
- Proper 301 redirect chains (no chains > 1 hop)
- Canonical tag verification
- Sitemap submission to Google Search Console
- Backlink profile preservation
url-redirect-generator.php— Batch .htaccess rule generationsearch-replace-db.php— Serialization-safe DB search/replace with loggingpost-migration-health-check.php— Automated broken link and canonical checker
| Tool | Version | Purpose |
|---|---|---|
| PHP | 7.4+ | Running the scripts |
| MySQL/MariaDB | 5.7+ | Database operations |
| WP-CLI | 2.x | Optional, for advanced operations |
| Screaming Frog | Any | Pre-migration URL crawl |
- Crawl before you migrate. Export all URLs from Screaming Frog before touching anything.
- Map every URL. Any URL that changes needs a 301 redirect. No exceptions.
- Avoid redirect chains. A→B→C costs you link equity. Flatten to A→C.
- Preserve canonical tags. Make sure they point to the new domain, not the old one.
- Update internal links. Redirects are a fallback, not a substitute for correct URLs.
- Submit sitemap immediately. Help Google discover the new structure fast.
- Monitor for 30 days. Check Search Console daily for coverage and crawl errors.
| Pitfall | Prevention |
|---|---|
| Serialized data corruption | Use search-replace-db.php, never raw SQL |
| Staging URLs left in content | Run health check script after migration |
| Missing image redirects | Include /wp-content/uploads/ in URL crawl |
| SSL mixed content | Force HTTPS in wp-config.php + scan with health check |
| Redirect chains > 1 hop | Health check script detects and reports chains |
| DNS TTL not lowered | Lower to 300s 48 hours before cutover |
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT License — see LICENSE for details.
Built for professional WordPress migrations. Tested on 50+ production migrations ranging from simple blogs to enterprise WooCommerce stores.