How to repair a hacked website and stop it coming back
To repair a hacked website for good, you need to do more than delete the bad files. Find how the attacker got in, replace WordPress, theme and plugin files with clean copies, remove unknown admin users, update everything, change every password once the site is clean, then ask Google to review it. If you skip a step, the same hack often comes back.
Why does the hack keep coming back?
A repeat hack usually means something was left behind after a quick cleanup:
- The way in is still open. Google lists old software, weak or reused passwords and plugins or themes from untrusted sites as the most common ways in. If the outdated plugin is still there, the attacker walks back in.
- A backdoor is still hidden. Attackers often leave a small file or a few lines of code that let them return. It can sit in a plugin folder, an upload folder or the .htaccess file.
- The passwords were changed too early. WordPress.org points out that if you change passwords while the site is still infected, they can be stolen again. Change them once more after the cleanup.
Which files should I check?
WordPress.org suggests reinstalling the same version of WordPress core from a fresh download, then going through the wp-content folder carefully, since that is where themes and plugins live. It names the .htaccess file as the one most often changed by attackers, and there may be more than one in different folders.
Also look at:
- Users in WordPress with the Administrator role that nobody on your team created.
- Plugins or themes you do not remember installing, especially "free" copies of paid ones. Google warns these often carry hidden code.
- Files in the uploads folder that end in .php. Normal uploads are images and documents.
- Plugins that are deactivated but still on the server. Delete them fully. Google advises removing all of a plugin's files, not just switching it off.
How do I lock the site after cleaning?
- Update WordPress, every plugin and the theme to the latest version. WordPress.org says older versions are hacked more often.
- Change all the passwords again: WordPress admin, hosting control panel, FTP or SFTP, and the database user. If you change the database password, update it in wp-config.php too.
- Generate new secret keys for wp-config.php. This logs out anyone still signed in, including the attacker.
- Turn on two-step login for every admin account.
- Give admin rights only to people who need them. Google lists extra admin accounts as a common weakness.
- Keep a regular backup of files and database, stored away from the hosting account, so next time you can restore a clean copy fast.
How do I clear the Google warning?
Once every page is clean, open Google Search Console, go to Security issues and click Request review. Describe what you removed and what you fixed. Ask only when the whole site is clean.
What to do
- If the hack is still fresh, start with our first-hour checklist: note what you see, make a backup and scan the office PCs.
- Work out the likely way in: an old plugin, a weak password, a pirated theme or a staff PC with malware.
- Replace core, theme and plugin files with clean copies and check .htaccess and the uploads folder.
- Remove unknown admin users and any plugin you do not use.
- Update everything, change every password again and reset the secret keys.
- Request a Google review, then watch the site and Search Console for two weeks.
How SyncTech can help
Our hacked website repair and website care service can look for the way in, clean the files, apply the updates and keep an eye on the site afterwards.
Source and credit
We are sharing information from WordPress.org and Google. This guide is written by Synctech in our own words.
- FAQ My site was hacked, WordPress.org Documentation: https://wordpress.org/documentation/article/faq-my-site-was-hacked/
- Top ways sites get hacked by spammers, Google on web.dev: https://web.dev/articles/top-ways-sites-get-hacked-by-spammers
- FAQ for hacked sites, Google on web.dev: https://web.dev/articles/faq-for-hacked-sites
- Help, I think I've been hacked, Google on web.dev: https://web.dev/articles/hacked Retrieved 17 November 2026. WordPress and Google are trademarks of their owners. Synctech is not connected with them. This is general information, not legal, tax or financial advice. If anything here is wrong, email support@synctech.com.my and we will correct it.
Related announcements
-
Website hacked or broken? What to do in the first hour
1 November 2026
-
Apache web server flaw now under attack: update to 2.4.71
17 November 2026
-
NoisyTCP Linux kernel flaw CVE-2026-99288: what server owners do
17 November 2026
-
Creative Sound Blaster and Pebble speaker flaws: what to update
17 November 2026
Questions? Open a ticket or WhatsApp +6016-7618518.