A successful migration is invisible. On switch day, visitors reach the new site through the same URLs, search engines find every page again, and email keeps arriving. This guide sets out the method for moving a site off WordPress in that order, from the first backup to shutting down the old install.
By Simon Vasconcelos Lee
Published on 1 December 202611 minute read
The first backup is both your safety net and your source. Take it from the site exactly as it is, before a single line changes:
wp db export backup-before-migration.sql
tar -czf uploads.tar.gz wp-content/uploads
Without WP-CLI, export the database from phpMyAdmin (Export tab) and copy the files over SFTP. Then set a content freeze date: from that day on, no more edits on the old site, or they will be lost. This is also when you list the plugins and the features that will need replacing.
The URL list is the backbone of the migration: every line needs a place on the new site, or a redirect. Build it from three sources, which never quite overlap:
/wp-sitemap.xml, or /sitemap_index.xml with Yoast SEO and Rank Math), or the command below.wp post list --post_type=page,post --post_status=publish --fields=ID,post_type,post_title,url --format=csv > urls.csv
The Tools > Export screen in WordPress produces an XML file (in WXR format) holding pages, posts, categories, tags and comments. It holds the URLs of your images, not the images themselves: those come from the copy of wp-content/uploads. Theme settings, widgets and plugin settings are not in it.
wp export --dir=./export
SEO titles and descriptions typed into a plugin are stored as page metadata. Collect them before you leave:
wp post meta list 123 --keys=_yoast_wpseo_title,_yoast_wpseo_metadesc
Finally, clean up the copy: a site built with Elementor, Divi or WPBakery comes out mixed with shortcodes or layout data, and internal links often carry the old site’s full address.
The safest redirect is the one you never need. Wherever the new platform allows it, reuse each page’s exact URL, trailing slash included. Carry over the title, the description, the headings and the image alt text. Point internal links straight at the new URLs rather than through redirects.
Every URL that changes gets a permanent redirect (301 or 308) to the page that replaces it, or to the closest page in meaning when it disappears. Redirecting the whole site to the home page loses the rankings of inner pages: Google may treat those redirects as missing pages (so-called soft 404 errors). The WordPress-specific URLs are the ones people forget:
| WordPress URL | Example | What to do |
|---|---|---|
| Dated posts | /2024/03/my-post/ | Redirect to the post on the new site |
| Categories and tags | /category/news/, /tag/offer/ | To the matching list, or to the closest section |
| Author pages | /author/admin/ | To the About page or the blog home |
| Pagination | /page/2/, /category/news/page/3/ | To the first page of the list |
| RSS feeds | /feed/, /comments/feed/ | To the new feed if there is one, otherwise to the post list |
| Short URLs | /?p=123, /?page_id=45 | To the matching page |
| Attachment pages | /my-post/photo-1/ | To the post that contains the image |
| Media | /wp-content/uploads/2024/03/prices.pdf | Keep the same path, or redirect each file linked from elsewhere |
Keep the map in a spreadsheet, one row per old URL, then load it into the redirect tool of the new platform or host.
Test the new site on the real domain, before the DNS changes, by pointing the domain at the new server on your own computer only. This command does it for a single request, without changing anything:
curl -I --resolve www.your-site.com:443:203.0.113.10 https://www.your-site.com/2024/03/my-post/
To browse, add the same mapping to your hosts file (C:\Windows\System32\drivers\etc\hosts on Windows, /etc/hosts on macOS and Linux). Then run through the URL list: every line must return 200, or a 301 to a page that returns 200. Check the contact form, the HTTPS certificate, the versions with and without www, and how the site looks on a phone.
A and AAAA records (or the www CNAME) to point at the new site. Leave the email MX and TXT records alone.Once the new site is stable, delete the old WordPress install, database included, rather than leaving it online on a subdomain or in a folder. A forgotten WordPress site gets no more updates and stays a way into the hosting account, and into every site that shares it. Keep the first backup off the server, then cancel the hosting once nothing depends on it, email included.
With Serenity by Simafri, we take over your WordPress site: we rebuild it, keep your URLs and your rankings, host it, secure it and keep it up to date. No third-party components for you to update, no admin exposed online. Domain name free for the first year and registered in your name, professional email included.
For a business website of about twenty pages, preparation, rebuilding and testing take days; the switch itself takes minutes if the TTL was lowered in advance. What makes it longer: the number of URLs to carry over, a page builder to clean up, and plugin features to replace.
At least a year, and as long as you can. Google recommends keeping them for a minimum of one year, and links published elsewhere will keep pointing at the old URLs long after.
Yes. The new site is built and tested alongside the old one, on the real domain thanks to the hosts file, and then only the site’s DNS records change. With the TTL lowered in advance, the switch takes minutes, and the old site still answers visitors whose DNS has not caught up yet.
They keep their place if their URL stays the same, or if each old URL redirects to the new image. The simplest approach is to keep the /wp-content/uploads/ paths on the new site, or to redirect that folder as a block to its new location.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.