How to Move WordPress From Localhost to Live Server (8 Steps)
I’ll be honest. The first time I tried to move WordPress from localhost to live server, I broke three things before lunch. WebLearnCraft lived on my laptop for about two weeks: XAMPP, a local database, a lot of late nights fiddling with headers. I figured putting it online would take an hour, tops.
It took most of a Saturday.
Not because the move itself is hard. It isn’t. It’s the little stuff afterwards. Buttons still pointing at localhost. Pages that had somehow turned into drafts. A footer that looked perfect in Elementor and fell apart on the real site. So this is the guide I wanted that morning, with the boring-but-important fixes included. I used Hostinger, but if your host gives you a WordPress installer and a file manager, the steps are pretty much the same.
Before you start, grab these three things
A domain that’s already pointed at your hosting. Bought both from one company? Then it’s probably done already.
A blank WordPress install on the live server. Use your host’s one-click installer. You want WordPress sitting there empty and waiting, not an empty folder.
Your local site, running. Open it once. If it throws errors on your laptop, it’ll throw them on the server too, so sort those out first.
Step 1: Clear out the junk first
Before exporting anything, have a quick clean. I had four plugins I’d installed “just to test” and never touched again. Delete those. Empty the trash in Posts and Pages. And if “Hello world!” or “Sample Page” is still hanging around from day one, get rid of them.
Why bother? Everything goes into the export file, old revisions included. Smaller file, fewer failed uploads.
While you’re in the dashboard, peek at Settings, then Permalinks, and remember what’s selected. It should be “Post name”. If it isn’t, it probably should be. You’ll need the same setting on the live site.
Step 2: Export with All-in-One WP Migration
You can move a site by hand, copying files over FTP and exporting the database from phpMyAdmin. I’ve done it. I wouldn’t recommend it for your first time. One wrong character in a config file and you’re staring at a white screen.
The easier route is a plugin. Install All-in-One WP Migration on your local site. A new menu item shows up in the sidebar. Click it, then Export, then Export To, then File.
It bundles everything (database, images, themes, plugins) into one .wpress file. Download it. Mine came out at 180 MB, and to be fair most of that was images I should’ve compressed.
One catch. The free version won’t import files over 512 MB. If yours is bigger, trim your media library, or ask your host to do the migration for you. Hostinger has a free migration request in hPanel for exactly this.
Step 3: Import it on the live site
Log in to the fresh WordPress on your host. Install the same plugin. Then Import, Import From, File, and pick your .wpress file.
You’ll get a scary warning saying everything will be overwritten. Good. That’s the whole point. Click proceed. My 180 MB file took about four minutes. Don’t close the tab while the progress bar is still moving, or you’ll have to start over.
When it’s done, the plugin asks you to save your permalinks. Don’t skip this bit. Click the link, choose Post name (or whatever you had locally) and hit Save Changes, even if it already looks right. That click rewrites how the server handles your URLs, and forgetting it is the most common reason people get 404 errors right after a migration.
Heads up: your login changes too. From now on you sign in with the username and password from your local site, not the one your host emailed you.
Step 4: Hunt down every localhost link
This is the step most tutorials skip, and it’s the one that bit me.
WordPress updates your main site address during the import. What it doesn’t always touch: links buried inside your content. Buttons. Footer menus. Images inside Elementor sections. Anything you typed as a full URL. Those can still say localhost/mysite/about-us, which works fine on your laptop and nowhere else.
Quick way to spot them: open the live site, hover over buttons and footer links, and watch the little URL preview in the bottom-left corner of the browser. See “localhost” or “127.0.0.1“? That’s one.
If you use Elementor, there’s a built-in fix. Go to Elementor, Tools, Replace URL. Old local address in the first box, live address in the second, click the button. Do it twice, once with index.php in the old address and once without, because local installs love to mix both. Then click Regenerate CSS & Data on the same screen.
Not on Elementor? The free Better Search Replace plugin does the same thing across the whole database. Tick “dry run” first so you can see what it’s about to change.
My confession: I skipped this. For two whole days, the View All Articles button on my homepage sent people to a page that only existed on my laptop.
Step 5: Click through every single page
The homepage almost always survives. It’s the pages you built last, at 1 a.m., that break.
Open each one in a new tab and scroll all the way down. You’re looking for broken image icons, sections missing their background, forms that look plain and unstyled, and footers still showing an old name or last year’s date. Got a 404? Go back to Permalinks and save again.
Then do the whole thing again on your phone. Elementor keeps separate settings for mobile, so a section that looks lovely on desktop can be squashed or overlapping on a small screen. Most of my own fixes after launch were mobile ones, not desktop.
This one caught me off guard. I’d trashed a few pages locally and restored them later. WordPress doesn’t bring them back as published. It brings them back as drafts. So on the live site they just… weren’t there. If a page vanishes, open Pages, click the Drafts filter, and hit Publish.
Step 6: Get email working
Here’s something you won’t notice on localhost, because nothing sends email there anyway. On a lot of shared hosting, WordPress can’t send email properly either. Your contact form says “Thanks, message sent!” and the message goes nowhere.
The fix I use is WP Mail SMTP. In setup, pick Other SMTP and fill in your host’s mail details. For Hostinger it’s smtp.hostinger.com, port 465, SSL, plus the email and password of a mailbox you’ve made in hPanel. Send yourself the test email from the plugin’s Tools tab. Then fill in your own contact form the way a visitor would, and check your inbox. Don’t trust it until you see it land.
No mailbox yet? Make one first, something like contact@yourdomain.com. Sending from a Gmail address through your site tends to end up in spam folders, which defeats the whole point.
Step 7: Switch back on what you switched off
Loads of people build locally with “Discourage search engines from indexing this site” ticked, under Settings, then Reading. The import copies that setting across. Untick it. Otherwise Google will politely ignore you forever.
Using a maintenance or coming-soon plugin? Turn it off. And if your host has caching, purge it once now so nobody gets served a cached copy of the broken version.
Step 8: Let Google know you exist
You don’t have to wait around for Google to stumble onto your site. Add it to Google Search Console, verify it, and submit your sitemap. With Rank Math that’s sitemap_index.xml. With plain WordPress it’s wp-sitemap.xml. Then paste your homepage URL into the inspection bar at the top and click Request Indexing. Do the same for your main pages.
It still takes a few days to show up. Clicking the button ten times won’t speed it up. I tried.
Take a backup the moment it works
Once everything checks out, back it up straight away. Hostinger keeps daily backups, but I like having my own copy too. Run the All-in-One WP Migration export again, this time on the live site, and keep that file somewhere safe. If a plugin update ever wrecks something, you can roll back in five minutes instead of rebuilding from scratch.
How to move WordPress from localhost to live server: my final checklist
Before telling anyone the site is live, I run through this:
- Permalinks saved on the live site
- Zero localhost links (buttons, menus, footer, images)
- Every page opens, nothing stuck in Drafts
- Contact form actually delivers email
- Search engine visibility switched on
- Sitemap submitted
- Cache cleared
Want the long version? Our free Website Launch Checklist has 42 checks, speed and security included.
When the import won’t finish
Two things usually go wrong. An “upload limit” error means your file’s too big for your host. Delete unused images and plugins locally, export again, try again. A timeout halfway through? Refresh and run the import again. It normally gets through the second time, since most of the file is already up there.
Still stuck? Open a support ticket and ask your host to migrate it. Most will do it for free, and it’ll save you an evening.
Look, the transfer part takes ten minutes. The checks after it are what turn a copied site into one that actually works for visitors. Do them once, do them properly, and you’re done. If something else breaks along the way, our other WordPress guides probably cover it.
good content
I really understand from this article.That great.
For more useful content visit our website blog page