How to Move WordPress from Localhost to a Live Server

WordPress

How to Move WordPress from Localhost to a Live Server

Launch a locally built WordPress website on live hosting by moving its files and database, replacing local URLs, and testing the production environment.

By Xenoy··Updated September 30, 2026
How to Move WordPress from Localhost to a Live Server

Building WordPress locally is convenient. No visitors. No pressure. The hard part comes when the site has to work on a real server with a real domain, SSL, email, and different PHP settings.

Treat launch as a migration, not an upload. That mindset prevents most of the mistakes below.

Prepare the Local Site

Update everything to a stable point. Test the important pages locally. Remove temporary admin accounts, test content, and development-only plugins you're sure you don't need.

Create a full backup: database plus the complete wp-content folder. Store it outside the local WordPress directory.

Before exporting, write down:

  • Local site URL
  • Active theme and plugins
  • Permalink structure
  • Required PHP version and extensions
  • Any custom code or server rules

Prepare the Live Hosting

Add the domain to the hosting account. Create the document root. Enable SSL. Check the host's PHP version and raise it only to a version your theme and plugins support.

If you're using a migration plugin, install a fresh WordPress at the destination. If you're moving manually, create a database and user. Save the credentials somewhere safe.

Block search engines while testing. Use hosting access protection or a maintenance mode. Don't forget to remove it at launch.

Option 1: Move With a Plugin (Recommended for Most Sites)

An export-and-import plugin is the easiest route. All-in-One WP Migration creates a .wpress file locally and imports it into a fresh live install. UpdraftPlus restores a full backup set. Duplicator deploys an archive through its installer.

Let the plugin handle URL replacement. Don't manually edit the SQL file. Confirm the destination server can accept the archive size before starting.

Option 2: Move Manually

For a manual move:

  1. Upload WordPress files to the live document root.
  2. Export the local database.
  3. Import it into the live database.
  4. Update database values in wp-config.php.
  5. Replace the local URL with the live domain using WP-CLI or a serialization-aware tool.
  6. Confirm WordPress Address and Site Address in Settings → General.
  7. Save permalinks to rebuild rewrite rules.

Don't run a raw search-and-replace in a text editor against the whole database. WordPress's migration guide explains that themes, widgets, and plugins store serialized values that depend on exact string lengths. One wrong replacement and the site breaks.

Replace Local-Only Settings

A live site needs services localhost never had. Check:

  • SMTP or transactional email
  • Payment gateway live keys
  • Analytics and tag-manager IDs
  • CAPTCHA domain settings
  • Webhooks and API callback URLs
  • Cookie and privacy settings
  • Backup schedules
  • Caching and CDN configuration

Keep payment gateways in sandbox mode until a full test order succeeds.

Test Before Public Launch

Preview the site through a temporary URL or a local hosts-file entry. Test the homepage, inner pages, navigation, media, forms, login, search, mobile layout, and error pages.

Open the browser console and the hosting PHP log. A site can look fine while background requests, fonts, or scripts still point to localhost.

Check Settings → Reading. Development sites often have "Discourage search engines" enabled. Turn it off when the site is ready to be indexed.

Point DNS and Watch the First Few Days

Update DNS only after the production copy passes testing. Once the domain resolves to the live host, clear caches and test from a separate network.

Watch forms, email, scheduled tasks, analytics, and security logs for the first few days. Keep the local copy and the launch backup until production proves stable.

Before You Call It Done

Moving from localhost is the final stage of development, not an afterthought. Transfer the full site, replace URLs safely, configure the real services, and test the public environment before inviting visitors in.

Keep the local copy around for a week. You'll be glad you did if something surfaces after launch.

X

About the author

Xenoy

View profile

Continue reading