Building a WordPress site locally on your computer is fast and private, but at some point it needs to go live on a real server. Moving it involves copying files and the database and updating URLs from the local address to the real domain. Done carefully, it takes less than an hour. Here is how I do it.
Why build locally
Local development tools such as LocalWP, DevKinsta, MAMP or Docker-based setups let you build and test WordPress on your own computer. Sites load instantly, you can work offline and experiments do not affect anyone.
When the site is ready, or ready for client review, it moves to staging or live hosting.
Prepare the local site
Before moving, clean up: delete unused themes, plugins and test content, empty the trash and remove development-only plugins. Make sure WordPress, plugins and themes are up to date. Note the PHP version and any server settings the site needs.
Check that the live host meets the same requirements. See choosing WordPress hosting.
- 1Clean upRemove test content
- 2Prepare serverDomain, SSL, database
- 3TransferPlugin or manual
- 4Search and replaceSerialised-safe
- 5Test and securePermalinks, SMTP, passwords
Prepare the live server
Set up hosting, point the domain to it and install an SSL certificate. Create an empty database and database user with full privileges, or let a migration plugin or host tool handle this. Make sure PHP version and memory limits are suitable.
If the domain currently has a live site, build on a staging environment or temporary URL first, then switch.
Option 1: migration plugins
Plugins such as All-in-One WP Migration, Duplicator and Migrate Guru package the entire site, including files and database, and handle URL replacement automatically. Install the plugin locally, create an export or package, then import it on the live server.
This is the easiest method for most sites. Large sites may hit upload limits on free plugin versions; check the plugin’s limits.
Option 2: host migration tools
Some hosts and local tools integrate directly. LocalWP can push sites to some hosts, and DevKinsta pushes to Kinsta. Managed hosts may offer import tools or free migrations.
These integrations save time if your local tool and host support them.
Option 3: manual migration
For full control, export the local database using phpMyAdmin, Adminer or WP-CLI. Upload the WordPress files to the server’s web root using SFTP. Import the database into the live database using phpMyAdmin or the command line.
Edit wp-config.php on the server with the live database name, user, password and host.
Search and replace URLs
The database contains the local URL, such as http://mysite.local, in many places, including serialised data used by themes and plugins. Replace it with the live URL, such as https://www.mysite.com, using a tool that handles serialised data safely.
WP-CLI’s search-replace command, Better Search Replace or the migration plugin’s built-in replacement work well. Never use a simple text find and replace on the SQL file, which can corrupt serialised data.
Update settings
Log in to the live site and check Settings > General for the correct WordPress Address and Site Address. Re-save permalinks under Settings > Permalinks to regenerate rewrite rules. Check that the search engine visibility setting is correct for the live site.
If you developed with ‘Discourage search engines’ ticked, untick it at launch. See technical SEO audit.
Check files and permissions
Make sure all files transferred, especially the uploads folder with images. Set correct file permissions, usually 755 for folders and 644 for files. See WordPress file permissions.
Check that .htaccess, if used, contains the WordPress rewrite rules.
Test thoroughly
Browse the live site and check every key page, images, menus, forms, search and login. Look for mixed content warnings from http resources. Test on mobile. Check the browser console for errors.
Set up SMTP for email and test forms. See WordPress SMTP setup.
Security and performance
Change any simple local passwords, remove unused admin accounts and install security, backup and caching plugins suited to the live host. Local sites often use weak settings that are unsafe online.
See WordPress security hardening and WordPress caching explained.
Ongoing workflow
After launch, keep the local copy for development and testing, and use staging for client review. Pull the live database down to local occasionally so you work with current content, and push code changes up carefully.
Version control with Git helps manage code changes. See why every site needs staging.
Getting help
I build sites locally and deploy them to staging and live servers as part of every project in my WordPress development service. For moving existing live sites, see moving WordPress between hosts.
For installation basics, read how to install WordPress.
Key takeaways
- Migration plugins handle files, database and URLs automatically.
- Use serialised-safe search and replace for URL changes.
- Re-save permalinks and check search engine visibility after moving.
- Secure the live site with strong passwords and essential plugins.
Frequently asked questions
What is the easiest way to move a local site live?
A migration plugin such as All-in-One WP Migration or Duplicator.
Why are my images missing after moving?
The uploads folder may not have transferred, or URLs were not replaced.
Why do I get 404 errors on pages?
Re-save permalinks to regenerate rewrite rules.
Can I use find and replace on the SQL file?
No. It can corrupt serialised data. Use WP-CLI or a dedicated tool.
Which local tool is best?
LocalWP is popular and easy. DevKinsta and Docker-based tools are alternatives.
Do I need to change wp-config.php?
Yes, with the live database details, unless a migration tool handles it.
Should I develop with search engines discouraged?
On public staging, yes. Remember to untick it at launch.
Can I move a site live without a plugin?
Yes. Upload files by SFTP, import the database, update wp-config.php and run a serialised-safe search and replace.
What if the live server uses a different PHP version?
Match or exceed the local version and test thoroughly, since older PHP may not support your plugins.
Do I need SSL before going live?
Yes. Install a certificate on the live domain first so the site loads over HTTPS from launch.
