If your WordPress website has been hacked, work through four steps in this order. Contain it by taking the site offline or into maintenance mode. Change every password and revoke the logins that matter. Restore a clean backup from before the break-in, or have the site professionally cleaned if you do not have one. Then find and close the hole that let them in, because a clean site with the same weakness open will simply be hacked again. Here is what each of those steps actually involves.
First, check it really is a hack
Plenty of sites that look hacked are actually broken. A plugin conflict, an expired certificate or a failed update can all produce alarming screens. Signs that point to a genuine compromise include spammy pages or links you did not create, visitors being redirected to another site, a Google warning in search results, admin accounts you do not recognise, or your host suspending the account.
If you can still log in, check Users for unfamiliar accounts and check the dates on your files through your host’s file manager. Anything modified at 3am on a day nobody touched the site is worth a closer look.
The first hour: contain the damage
Speed matters more than tidiness here. Work through this list:
- Put the site into maintenance mode or take it offline, so visitors are not exposed to malware or spam.
- Tell your hosting provider. Good hosts deal with this regularly and can often see what happened in the server logs.
- Change the passwords for WordPress admin accounts, hosting, FTP or SFTP, the database and the email address tied to your admin login.
- Take a full copy of the site as it stands, including the database. It is evidence, and you may need it later.
- Remove any user accounts you do not recognise, and force a logout of all active sessions.
Resist the urge to start deleting suspicious-looking files straight away. It is easy to break the site further and lose track of what was changed.
Clean it up properly
There are two honest paths, and which one you take depends on how well you back up your WordPress website.
If you have clean backups, restore one from before the compromise. The tricky part is knowing when the break-in happened. Attackers often sit quietly for weeks, so restoring last night’s backup can restore the problem with it. Work backwards until you find a version that is genuinely clean, then re-enter any legitimate content added since.
If you do not have usable backups, the site needs cleaning. That usually means replacing WordPress core and every plugin and theme with fresh copies from official sources, then carefully going through the database and uploads folder for injected code, redirects and hidden admin users. This is fiddly work and it is worth paying someone who does it often. Missing one back door means the whole exercise is wasted.
Close the door behind you
Most WordPress compromises come through an out-of-date plugin or theme, a weak or reused password, or old hosting running unsupported software. Once the site is clean, update everything, delete plugins and themes you are not using, turn on two-factor authentication for admin accounts, and cut back the number of people with full administrator access.
If the site was running on cheap shared hosting that has been ignored for years, moving to better WordPress hosting is often the single most useful change you can make. It is one of the things we look at first when we take on WordPress development work for a site somebody else built.
Tell the people who need to know
If customer details, orders or form submissions may have been exposed, you have obligations beyond fixing the website. Australian privacy law requires notification of eligible data breaches, so speak with your accountant or a solicitor if personal information was involved. Do not guess at this part.
You should also request a review in Google Search Console if your site was flagged, so the warning is lifted once the site is clean.
Making the next one far less likely
Nothing makes a website unhackable, but ongoing care makes a compromise both less likely and much less painful to recover from. Regular updates, offsite backups you have actually tested, uptime and malware monitoring, and a tidy list of admin users cover most of it. That is the bulk of what a maintenance plan does, and you can see how we handle it as part of our services. For larger systems and custom applications sitting behind a site, our sister studio Defyn looks after the heavier builds.
Dealing with a hacked site right now, or want someone keeping an eye on yours? Call us on 02 9834 4119 or get in touch and we will help you sort it out.
Need a WordPress website, theme or plugin built properly? We would love to help.
Start a project



