📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials WordPress Development WordPress Deployment

WordPress Deployment

5 min read
Deploy with WP-CLI search-replace for URLs, rsync for files, and export/import for the database.

WordPress Deployment

# Migrate local to production
# 1. Export local DB
wp db export local.sql

# 2. Replace URLs (always use WP-CLI not plain sed!)
wp search-replace 'http://localhost/mysite' 'https://mysite.com' --all-tables

# 3. Upload files
rsync -avz --exclude='wp-content/uploads' . user@server:/var/www/html/

# 4. Import DB on server
wp db import local.sql

# Migration plugins (easier)
# All-in-One WP Migration
# Duplicator
# WP Migrate DB Pro

# GitHub Actions deploy
- name: Deploy
  run: |
    rsync -avz . user@server:/var/www/html/
    ssh user@server 'cd /var/www/html && wp cache flush'

# Server requirements
# PHP 8.0+, MySQL 8.0+, HTTPS, mod_rewrite enabled