How to Migrate a Hacked WordPress Site to a Secure Host

By Donald Korinchak, MBA, PMP, CISSP, SecurityX, ITILv3   Published: 12/04/26   13 min read

This article contains affiliate links. CyberExperts may earn a commission if you buy through them, at no extra cost to you.

If a WordPress site has been compromised, moving it is not the same as moving a healthy site. Copying every file and the database onto a new server will also copy the backdoor, the rogue admin user, and the infected plugin. The goal is a clean site on a host that can contain the next attempt, not a faster copy of the same incident.

This article is about that migration. For first-hour triage on the current server (contacting the existing host, taking the site offline to visitors if needed, and avoiding a panicked wipe that destroys evidence), start with our earlier guide, What to do if your WordPress site gets hacked. Then use the process below to leave a weak environment without taking the malware with you.

Decide whether to clean first, or migrate into a cleanup

You have two workable paths. Both are valid. Mixing them badly is how infections recur.

Clean, then move. If your current host will isolate the site, provide backups and logs, and let you or a specialist rebuild from a known-good backup, do that work first. Reinstall WordPress core from wordpress.org, replace themes and plugins with fresh copies from the official source, restore only the content you have inspected, and scan again before you involve a new host. This is the right path when the current host is cooperative and you need to stay on it for a short time (for example, a contract you cannot exit this week).

Migrate into a host that scans and cleans as part of the move. If the current host is unresponsive, has no usable backup, or is itself part of the problem (poor isolation, no WAF, no malware help), pick a destination that will inspect the incoming files, pause if malware is found, and offer a documented cleanup rather than blindly copying the infection. This is the path most owners want when the compromise is also the reason they are changing hosts.

Do not take a third path: download a zip of the live site, upload it to a cheap account, and point DNS. That relocates the attacker with you.

Treat every credential as burned

A WordPress compromise is rarely “just WordPress.” Assume the attacker could have captured any secret that was stored on the site, typed into wp-admin, or sitting in wp-config.php. Before or during the move, plan to rotate:

Store the new secrets in a password manager. Enable MFA on the registrar, DNS, new hosting dashboard, and WordPress. If you will use SFTP or wp-admin from an untrusted network during the move, do it through a VPN or an IP allowlist, not a coffee-shop Wi-Fi session.

Do not reuse the old passwords on the new host. If the attacker still has them, a clean server will not stay clean.

Preserve evidence before you delete anything

It is tempting to wipe the account immediately. Resist that until you have a copy you control.

Those artifacts help a cleanup team find the persistence mechanism (a mu-plugin, a dropped PHP file, a database option, a rogue admin). They also help you later when you need to tell customers, insurers, or a developer what happened. If you already work with a specialist, give them the package before the old host recycles the account.

If the destination host will perform the cleanup, do not reset or randomly delete files first in a way that removes the only copy of the infection. Limit visitor exposure with maintenance mode or by taking the site offline, and keep the evidence package.

Choose a destination host for a post-incident move

Use a security checklist, not a speed benchmark, to pick the new host. At minimum you want site isolation (so this infection cannot touch other properties), a managed WAF and DDoS layer in front of the origin, daily backups with a published retention window, staging, MFA on the dashboard, and a written malware policy, including what happens when the incoming migration is dirty.

Budget shared hosting can still be a later home for a low-risk brochure site after it is clean, but it is a poor place to perform incident recovery if cleanup, isolation, and logging are mostly your problem. A managed WordPress platform is usually the better temporary (and often permanent) landing zone after a hack, because the migration and cleanup can be part of the service.

Kinsta’s managed WordPress hosting is built around that model. As of December 4, 2026, Kinsta’s public documentation states that all plans include unlimited free WordPress migrations performed by its team, and that a deep scan of site files is a standard step. If malware is found, Kinsta says it pauses the migration and gives you a choice: proceed and have Kinsta remove the infection, or cancel, clean the site on the old host (yourself or with a third party), and reschedule. When Kinsta removes malware during a migration, infected files are quarantined in the site’s ~/private directory rather than permanently deleted, so you can review them later and they are not web-accessible.

Other details that matter after an incident, drawn from the same public pages:

Remove nulled or pirated plugins and themes before you ask any host for a free cleanup. They are a common source of the original infection, and they are a common reason a cleanup promise does not apply.

A practical migration sequence

The exact buttons differ by host. The security order should not.

1. Open the new account and lock it down first

Create the destination account before you transfer files. Enable MFA immediately. Invite colleagues with least-privilege roles, not a shared password. Confirm you have an open site slot if the plan caps the number of installs. Add the new dashboard login to your password manager.

2. Put the live site into a controlled state

Note what visitors and search engines are seeing (malware warning, redirect, defacement). Enable maintenance mode if customers would otherwise hit a broken or malicious page. For stores and membership sites, plan a freeze: once the migration copy starts, new orders or posts on the old host will not appear on the new one unless you do a carefully scheduled cutover.

3. Request a professional migration, and disclose the compromise

Tell the destination team the site may be infected. Provide SFTP or SSH details, or a backup that includes files and the database. If the old host uses two-factor authentication that would block the migration team, follow that host’s process for granting access. Do not disable MFA globally to make the move easier.

Then stop making content or plugin changes on the source. Those edits will not be in the copy.

4. Let the new host scan; choose cleanup or a rebuild

If the scan finds malware, prefer a cleanup that replaces WordPress core with clean files and removes infected plugins and themes, plus a review of the database for injected content, spam users, and bad wp_options entries. If the site is too badly damaged, restore a pre-compromise backup into the new environment, then replay only the legitimate content you can verify.

Do not reinstall a “cleaned” copy of a nulled theme. Download a legitimate copy from the vendor, or replace the theme.

5. Preview on the new host before you touch DNS

Use the host’s preview or staging tool. Check:

Only when that preview is clean should you change DNS.

6. Cut over DNS, then watch

Lower the DNS TTL ahead of time if you can (for example, to five minutes) so the switch is reversible. Point the records to the new host, keep the old account paid and intact for a few days, and watch logs, uptime, email delivery, and Search Console. Request a review in Google Search Console if the site was flagged for malware or hacked content.

7. Harden the clean site the same day

This is the step that prevents a repeat:

If the new host offers tested automatic plugin and theme updates, decide whether to enable them after the site has been stable. On Kinsta, Automatic Updates are an optional add-on (stated at $3 per environment per month after a free first month as of December 2026) and include visual regression testing and rollback. They are not a substitute for removing abandoned plugins.

8. Close the old host only after the new one is boring

Do not cancel the old account the minute DNS is changed. Wait until the site has been clean and functional through a normal publishing or sales cycle, you have a tested backup on the new host, and you no longer need the old logs. Then close the old account, revoke its API keys, and remove leftover DNS or CDN records.

What success looks like

A successful move is not “the site loads on a new IP.” It is all of the following:

If any of those are missing, the incident is still open.

Frequently asked questions

Should I copy a hacked WordPress site straight onto a new host?

No. Copying every file and the database onto a new server will also copy the backdoor, the rogue admin user, and the infected plugin. Do not download a zip of the live site, upload it to a cheap account, and point DNS. The goal is a clean site on a host that can contain the next attempt, not a faster copy of the same incident.

Should I clean the site first, or migrate into a cleanup?

Both paths are valid. Clean, then move, if your current host will isolate the site, provide backups and logs, and let you rebuild from a known-good backup. Migrate into a host that scans and cleans as part of the move if the current host is unresponsive, has no usable backup, or is itself part of the problem. Mixing the two badly is how infections recur.

Why do I need to change every password after a WordPress hack?

Treat every credential as burned. That includes WordPress users, the database, hosting and control-panel logins, FTP, SFTP or SSH keys, the registrar, DNS, connected payment and email services, and application passwords or API keys. Store the new secrets in a password manager and enable MFA on the registrar, DNS, new hosting dashboard, and WordPress.

How do I migrate a compromised WordPress site without bringing malware along?

Preserve evidence first. Open and lock down the new account, put the live site into a controlled state, and tell the destination team the site may be infected. Let the new host scan; choose cleanup or a rebuild. Preview on the new host before you touch DNS, then cut over, harden the clean site the same day, and keep the old account until the new one has been clean through a normal publishing cycle.

When should I cancel the old hosting account?

Do not cancel the old account the minute DNS is changed. Wait until the site has been clean and functional through a normal publishing or sales cycle, you have a tested backup on the new host, and you no longer need the old logs. Then close the old account, revoke its API keys, and remove leftover DNS or CDN records.

Does this guide replace first-hour incident response?

No. For first-hour triage on the current server, including contacting the existing host, taking the site offline to visitors if needed, and avoiding a panicked wipe that destroys evidence, start with our earlier guide, What to do if your WordPress site gets hacked. This article is about the migration that follows.

Sources

Facts about Kinsta in this article were checked on December 4, 2026 against the company’s public pages, including Kinsta pricing, Kinsta WordPress security, unlimited migrations, migration documentation, malware removal terms, and Automatic Updates. Plan prices, fees, and policy details can change; verify them before you buy or request a migration.

Donald Korinchak, MBA, PMP, CISSP, SecurityX, ITILv3

Donald Korinchak is a Cybersecurity Professional in the Washington DC area. Donald holds an MBA from the University of Pittsburgh Katz School of Business. Donald is considered a thought leader in business, leadership, and cybersecurity issues.