How to Migrate a WordPress Site to a Custom Web App Without Losing Rankings
In this article
Moving a WordPress site to a custom web app is a six-step job. Audit what you have, export and clean the content, and map every old URL to a new one with a 301 redirect. Then rebuild the forms and integrations the plugins were doing, launch from a staging copy you have clicked through, and watch Search Console for a few weeks. Done in that order, the rankings carry across and nothing is lost.
The reason to move is rarely the blog. It is that the business has outgrown pages. It needs accounts, bookings, generated documents, a members' area or a shop with rules a plugin cannot express, and the plugin stack holding it together has become slow and fragile. The migration is the moment to get the content clean and the structure right, because you will live with both for years.
This is how we run it. If you are still deciding whether to move at all, our comparison of WordPress and Django for a business website sets out the trade-offs. This post assumes the decision is made.
1. Audit what you have and decide what moves
Start with a full list of what exists, not what you remember building. Three sources between them catch everything:
- A crawl of the live site with a tool such as Screaming Frog, which lists every page, image, PDF and redirect that is linked from anywhere.
- The Pages export from Google Search Console for the last 16 months, which lists every URL Google has shown in results, including old ones you had forgotten.
- Your analytics' top pages for the last year, so you know which pages carry the traffic.
Mark each URL keep, merge or retire, and be firm with thin posts; the migration is the cheapest moment to lose them. When we audited our own site in September 2026 against 16 months of Search Console data, we redirected 46 duplicate or weak posts to their strongest page and kept 31.
Then list every plugin and what it actually does. Each one is a feature you will rebuild, replace with something simpler, or drop. That list, with the URL list, is the brief for the whole project.
2. Export the content and clean it
Where WordPress keeps things
Pages, posts and most custom content live in the wp_posts table: slug in post_name, body in post_content, type in post_type, publish state in post_status. Custom fields live in wp_postmeta; if you used Yoast, your titles and descriptions are there under _yoast_wpseo_title and _yoast_wpseo_metadesc. Categories and tags sit in wp_terms and wp_term_relationships, and uploaded files in wp-content/uploads by year and month.
Tools, then Export, produces a WXR XML file. For anything beyond a small blog we read a database dump instead, because the XML loses some custom field detail and is awkward to re-run.
Cleaning the HTML
WordPress content is rarely clean HTML. Expect shortcodes in square brackets, Gutenberg block comments around every paragraph, and inline styles. Where a page builder such as Elementor was used, expect pages whose real content is a JSON blob in wp_postmeta rather than HTML at all. For those the only reliable route is to fetch the rendered page and capture the content area.
We write the import as a Django management command. It reads the dump, strips the HTML down to an allow-list of tags, rewrites image paths and loads the result into the new models. A command is repeatable. Run it against a fresh dump, fix what broke, run it again, and run it one last time on launch day so nothing written in the final week is lost.
The database underneath
WordPress runs on MySQL or MariaDB; our Django builds run on PostgreSQL. The migration is a one-off import rather than a live switch, but the same details bite. Those are character encoding, dates stored without a timezone, and columns that look like numbers but contain text. Our guide to moving a Django app from MySQL to PostgreSQL goes through those pitfalls one by one, and most of them apply here.
3. Build the URL map and the 301 redirects
This step is what protects the rankings. Every URL from the audit gets a row in a spreadsheet: old address, new address, reason. Retired pages redirect to the nearest useful parent, or return 410 if there is nothing to send people to. A 301 tells Google the page has moved permanently and passes its standing to the new address. Our post on canonical tags versus 301 redirects covers when each is the right tool.
The WordPress patterns that usually change:
- Date-based permalinks, with the year and month in the path, becoming /blog/post-name/.
- Category and tag archive pages, most of which merge into one blog index or are retired.
- Attachment pages. WordPress creates a page for every uploaded image; redirect each to the post it belongs to.
- Short links of the form ?p=123, author pages, feed URLs and paginated archives.
- Variants of the same page: with and without a trailing slash, with and without www, http and https. Pick one form and redirect the rest in a single hop.
Date-based posts can be handled with one pattern in Django rather than a row each. The explicit rows go in a redirect table the admin can edit after launch.
from django.urls import re_path
from django.views.generic import RedirectView
urlpatterns = [
re_path(
r"^\d{4}/\d{2}/(?P<slug>[-\w]+)/$",
RedirectView.as_view(url="/blog/%(slug)s/", permanent=True),
),
]
Three rules for the map. Every redirect is one hop, never a chain. Every redirect is a 301, not a 302. And the redirects stay in place permanently, because links from other sites and old bookmarks do not expire.
4. Rebuild forms, SEO fields and integrations without the plugins
Each plugin on the audit list maps to something in the new app. This is also where the project stops being a content move and becomes a web platform build, with accounts, payments, generated documents or integrations that WordPress was only ever approximating.
| WordPress plugin | What it was doing | In the custom app |
|---|---|---|
| Contact Form 7, Gravity Forms, WPForms | Forms and email notifications | Django forms with server-side validation, spam checks, stored submissions and an email to you |
| Yoast, Rank Math | Titles, descriptions, sitemap, schema | Title and description fields on every page model, Django's sitemap framework, schema in the templates |
| WooCommerce | Catalogue and checkout | A Django shop with Stripe checkout and your own pricing and postage rules |
| Booking and events plugins | Calendars and reservations | A booking model with live availability, payment and confirmation emails |
| Membership plugins | Logins and gated content | Django's own accounts, roles and permissions |
| Caching and security plugins | Page cache, login limits, firewall | Caching at the server, rate limiting and security headers in the app itself |
Integrations need their own list: accounting software, the payment provider, the email provider, the CRM or newsletter tool, analytics IDs, and anything that posts into the site through a webhook. Each is tested end to end on staging in test mode, because "the form sends" and "the lead reaches the CRM" are different claims.
5. Launch from staging
- Put the new app on a staging subdomain, behind a password and with a noindex header, so nothing indexes it early.
- Run the import against a fresh dump of the live site.
- Click through every page type yourself, then have the client do the same with their own content open alongside.
- Crawl staging with the URL map: every old address must return a 301 to a page that returns 200, and no new page should link to an old address.
- Check titles, descriptions, canonical tags, schema, sitemap.xml and robots.txt on a sample of each page type.
- Take a full backup of the WordPress site and its database and keep it for months, following the steps in our guide to backing up a website.
- Freeze content changes on the old site, run the import one last time, and lower the DNS TTL the day before.
- Switch DNS, confirm the SSL certificate is issued for the live domain, remove the noindex header, and watch the error log for the first hour.
6. The Search Console checks after launch
Rankings move over the weeks after launch as Google recrawls, and Search Console is where you watch it happen.
- Submit the new sitemap under Sitemaps and leave the old one listed until it reports zero pages.
- In the Pages report, watch "Not found (404)" and "Page with redirect". The redirect count should rise as Google recrawls; any 404 with impressions is a missing row in the map.
- Run URL Inspection on your ten most important pages and request indexing for any not yet picked up.
- Check the Core Web Vitals and HTTPS reports a fortnight in; a new build should pass both.
- In Performance, compare clicks per page for the four weeks before and after launch. A short dip is normal; a page that has lost everything has a redirect or canonical problem.
Our technical SEO audit checklist is the longer list to run once the dust has settled, with scripts for the checks that are worth automating.
Questions people ask
How long does a WordPress migration take?
A content site with a blog and some forms moves within the timescale of a normal business website build: as a rough estimate, two to four weeks. A site that is becoming a platform, with accounts, bookings or a shop, is sized by its journeys. A first version is a few weeks for one simple journey and a few months for several kinds of user, and it is quoted after a short call.
Will I lose my Google rankings?
Not if every old URL is redirected in one hop to a page with the same or better content. Expect a small wobble for a few weeks while Google recrawls. The migrations that lose rankings skipped the URL map, dropped content without redirects, or left the new site noindexed after launch.
Can I keep WordPress for the blog and move only the app?
You can, on a separate path or subdomain, but you then maintain two systems, two logins and two sets of templates. Most businesses move the lot and manage the blog in the new app's admin.
Where to start
Export the crawl and the Search Console pages report, and write the plugin list. Those three documents take an afternoon and are the brief for the whole migration. They also tell you, before anyone writes code, how much of the old site is worth keeping.
Then pick the one journey the new app must do that WordPress could not. Build that first on staging, with the content imported around it. A migration that leads with the feature the business needs, rather than a redesign, is the one that gets finished. We are a Bristol studio and do these migrations for businesses across the UK, from the first crawl to the Search Console checks after launch.