If your WordPress website has been hacked, don’t panic. You can take some simple steps to clean up the mess and secure your site. Take a backup before you start any work.
How to tell your WordPress site has been hacked.
The first step is checking if your WordPress site has been hacked. There are a few signs that you can look for:
- Your site is loading slowly or not at all
- You see new users or content that you didn’t add
- You’re getting strange error messages or warnings
- Your site is redirecting to another website
- If you see any of these signs, your WordPress site has likely been hacked.
- What to do if your WordPress site has been hacked
Once you’ve confirmed that your WordPress site has been hacked, it’s time to take action. Here are the steps you need to take:
General overview on how to fix a hacked WordPress website.
1. Change all your passwords
First things first: change all your passwords. This includes your WordPress password and any FTP or control panel passwords. Choose strong, unique passwords that are difficult to guess.
2. Delete any suspicious files
Next, delete any suspicious files from your server. If you’re not sure what’s suspicious, you can compare your list of files to a fresh WordPress install. Any files that don’t belong should be deleted.
3. Restore from a backup
If you have a recent backup of your site, now is the time to restore it. This will overwrite any infected files and get your site back up and running quickly.
4. Run a security scan
Once you’ve cleaned up your site, run a security scan to check for any remaining malware. Wordfence offers a free scanner that will check your site for many known vulnerabilities.
5. Take preventive measures
Finally, take some preventive measures to secure your site and prevent future hacks. Install a security plugin like Wordfence or Sucuri, and keep your WordPress installation up to date. By following these steps, you can quickly fix a hacked WordPress website and make sure it doesn’t happen again.
Sometimes you will also need to complete a manual cleanup, which we will discuss next.
In some cases, a simple security scan and plugin update isn’t enough to clean up a hacked WordPress site. If you suspect your site has been hacked, you can check for malicious code by looking at your source code.
If you find suspicious code in your files, delete it immediately. You may need to manually edit some of your core WordPress files, like wp-config.php or .htaccess. Be very careful when editing these files, as a single mistake could break your site.
Manually replace Core WordPress File.
- Login to your WordPress site via FTP
- Download a copy of the following files to your computer: – wp-admin/ and – wp-includes/
- Delete the originals from your server
- Upload the cleaned-up versions from your computer back to your server in the same locations you can download WordPress core files from https://wordpress.org/download/
- If you edited any core WordPress files, make sure you upload those as well
- You should now have a clean install of WordPress
Replace plugins and themes if issues persist.
- If you are using a custom theme file, delete it from your server
- Install a fresh copy of your theme files from the original source
- If you are using custom plugins, delete them from your server
- Install fresh copies of your plugins from the original source
- You should now have a clean install of WordPress
Check Permissions on files and folders.
WordPress is designed to have certain permissions set on files and folders. If the wrong permissions are set, it can create a security vulnerability.
The correct permissions for WordPress are as follows:
– Folders: 755
– Files: 644
– wp-config.php: 600
You can check and change file permissions through your FTP client or your file manager in your hosting control panel. If you’re not sure how to do this, contact your host for assistance.
Delete old website
Sometimes there are unused WordPress installations on your server that hackers can exploit. If you have any old WordPress sites that you’re no longer using, delete them from your server to reduce the chance of being hacked.
Change all passwords
Once you’ve cleaned up your site, it’s important to change all your passwords. This includes your WordPress password, as well as any FTP or hosting control panel passwords. Choose strong, unique passwords that are difficult to guess.
Install a security plugin
After you’ve taken measures to clean up and secure your site, install a security plugin like Wordfence or Sucuri. These plugins will help protect your site from future attacks.
Keep WordPress updated
One of the best ways to secure your WordPress site is to keep it up to date. WordPress releases new versions regularly, and each new update includes security fixes. By keeping WordPress up to date, you can help prevent future hacks.
You can keep WordPress up to date by enabling automatic updates or by manually updating it yourself. To enable automatic updates, go to your WordPress dashboard and click on Updates. Under the Automatic Updates section, select the option to enable automatic background updates.
If you prefer to update WordPress manually, you can do so from your WordPress dashboard. Go to Updates and select the updates you want to install.
No matter how well you secure your WordPress site, there’s always a chance it could be hacked. By following the steps in this article, you can quickly fix a hacked WordPress website and make sure it doesn’t happen again.
We have a great blog called 10 methods to protect your WordPress website. Have a read and find out how you can keep your website secure.
If your WordPress site keeps getting hacked, don’t panic. Follow the steps in this article to clean up your site and secure it against future attacks. By taking these measures, you can quickly get your site back online and reduce the chance of being hacked again. If you prefer Hosted WP to manage your site for you or need malware removal services. We’ll clean up your hacked WordPress site and secure it against future attacks. Contact us today to get started.