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.
Get the free 5-minute weekday brief
Scam alerts you can act on, major breaches, and our free Scam Survival Kit (PDF). Free, every weekday.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.
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:
- Every WordPress user password, especially Administrator accounts
- The database password and any database users
- SFTP, FTP, and SSH keys or passwords at the old host
- The hosting control-panel login
- Application passwords, API keys, webhook secrets, and payment-plugin credentials
- CMS-connected services (email delivery, CDN, forms, backups)
- The email account that receives password-reset messages
- The domain registrar and DNS provider, if those passwords were similar or reused
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.
- Snapshot or download the site files and database, and note the date and time.
- Export the WordPress user list and a screenshot of unexpected administrators, plugins, or scheduled cron jobs.
- Save access logs, error logs, and any malware-scanner reports the old host can give you.
- Record strange URLs, redirects, defacement screenshots, and Search Console or browser safe-browsing warnings.
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:
- Each site runs in an isolated Linux container, so a problem on one install is not supposed to reach others on the account.
- Traffic passes through Cloudflare for a managed WAF and Layer 3, 4, and 7 DDoS protection. Bot protection and Patchstack-powered vulnerability protection are included.
- Free wildcard SSL, SFTP and SSH, and a standard staging environment are included.
- Automatic daily backups are retained for 14 days on entry plans and up to 30 days on higher plans.
- If a site is later hacked while hosted at Kinsta, a security pledge offers free cleanup, with important limits: it does not apply to sites that use nulled plugins or themes (those must be removed first), it does not cover non-WordPress software or custom scripts, and you must complete Kinsta’s post-cleanup steps within one business day or future cleanups can incur a $100 fee.
- WordPress plans start at $35 per month, or $350 billed annually, for a single-site entry plan. Select plans advertise a first month free for new customers. After any free period, Kinsta states that plans are covered by a 30-day money-back guarantee. Migrations are performed Monday through Friday, not on weekends. Expedited migrations are offered and are described as completing in as little as eight hours; confirm any expedite fee on Kinsta’s site before you request one. Ecommerce, membership, and community sites generally need a maintenance window so orders and user-generated content are not lost between the copy and DNS cutover.
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:
- The home page and several interior pages, on a phone and a desktop
- Login, checkout, forms, search, and language or membership flows
- That unexpected redirects, spam pages, and unknown admin users are gone
- That HTTPS will work (issue or upload a certificate before go-live)
- That scheduled tasks and cron jobs look like yours
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:
- Update WordPress core, themes, and plugins to current official versions.
- Delete unused themes and plugins, including the default ones you do not use.
- Review every WordPress user; remove unknowns; drop Administrator where Editor or Author is enough.
- Rotate passwords and keys again if the cleanup team reset only some of them.
- Turn on MFA for remaining administrators.
- Confirm the WAF, bot protection, and automatic backups are active.
- Keep an independent backup of the clean state somewhere the new hosting password cannot delete.
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:
- Visitors reach a site that is not redirecting, defaced, or flagged as dangerous
- WordPress core and extensions came from official sources
- No unexplained admin users, files, or scheduled tasks remain
- Every related password and key has been changed
- MFA is on for hosting, WordPress, email, and the registrar
- Backups exist and a restore has been tested
- The old environment is no longer authoritative
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.
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
For everyday readers, small businesses and security teams. Unsubscribe anytime.