Remove malware from HostGator hosting
Knowing how to remove malware from HostGator hosting requires looking beyond a damaged website. Attackers may install PHP backdoors, steal cPanel or WordPress credentials, create administrator accounts, alter outgoing email, or publish spam pages. Reliable removal means regaining every access path, removing persistence and restoring verified clean files rather than deleting whichever suspicious file appears first.
Put the affected site into maintenance mode if visitors could see defacement, phishing or harmful downloads. Record what you observe, then use the HostGator customer resources to reach cPanel, webmail, invoices, domain tools, tutorials and support. Avoid repeated reinstalls or DNS changes during the investigation; they can overwrite evidence and leave another entry point untouched.
Confirm the compromise and preserve evidence
Confirm the compromise before changing files. Use Google Search Console to inspect indexed pages and security notices, and check the live domain in a browser. Visit HostGator webmail to spot unfamiliar forwarding rules or outbound spam. A browser warning, altered content, new administrator, unexplained email traffic or sudden indexing of keyword-heavy pages are all strong indicators.
Review cPanel access, error and mail logs, along with FTP or SSH activity if available. Search for repeated administrator-login failures, requests for unknown PHP files, uploads outside normal publishing patterns and logins from unfamiliar addresses. Convert timestamps to Australian time: Sydney and Melbourne shift between AEST and AEDT, while Brisbane remains on AEST. Include the timezone in any HostGator support ticket.
List indexed URLs and compare them with an editorial inventory. For a publishing site with varied subjects, the existing page on casino deposits in Australia should match its intended title, links and publication date. Fresh copies, altered destinations or sudden keyword pages suggest search-spam injection; remove them only after recording their paths and destinations.
Contain access and protect the account
Create a snapshot before remediation. Download the current database and a copy of affected files to separate, off-account storage, and retain the relevant logs. A HostGator backup can help, but a backup taken after infection may still contain malicious code. Keep it as evidence and a fallback, not as an automatic restore point.
Change every exposed credential: HostGator, cPanel, FTP or SFTP, WordPress, database, webmail and domain registrar. Use unique passwords generated in a password manager, enable multifactor authentication and revoke active sessions. Remove unknown administrator accounts, SSH keys, scheduled jobs and mail rules. A clean browser session helps distinguish your changes from the attacker’s.
Open a HostGator ticket with affected domains, Australian timestamps, suspicious URLs and relevant log extracts. Ask whether the plan includes an account-level malware scan, security monitoring or SiteLock support. Never include passwords or private keys. Keep copies of every ticket response so the cleanup history remains available during later restoration.
Remove infected files and persistence
Update the platform from a trusted source before replacing individual files. Bring PHP, WordPress, plugins and themes to supported versions, remove unused extensions, and reinstall core files or a compromised plugin from the vendor rather than the infected copy. Do not reuse an uploaded archive or backup that has not itself been checked.
Search cPanel File Manager or an SSH session for recently changed PHP, HTML and JavaScript files, especially in public_html, uploads and hidden directories. Inspect .htaccess, wp-config.php, cron files and code that decodes payloads, evaluates remote data or hides output. Compare suspect files with vendor originals; broad search-and-replace rules can delete legitimate code and spread the problem.
Quarantine confirmed web shells, backdoors and unauthorised scripts outside the web root, then remove them after documenting each finding. Restore altered files from a known clean copy, set directories to 755 and ordinary files to 644, restrict wp-config.php, regenerate application secrets and WordPress salts, and clear every cache. Recheck cron, scheduled tasks and authorised SSH keys for persistence.
Clean the database, email and DNS
Inspect the database through phpMyAdmin or a trusted SQL client. Check administrator accounts, user metadata, options, posts, comments and scheduled events for injected links, PHP payloads, unknown reset fields or spam accounts. Work from the pre-cleanup export, make narrow changes and test the front end, login and mail flow. Database garbage can recreate an infection after files appear clean.
Treat email as part of the compromised system. Reset webmail passwords, remove unfamiliar inbox filters, forwarding addresses, aliases and auto-responses, and review sent items and the mail queue for abuse. Confirm that SPF, DKIM and DMARC records still match the intended mail domain. An attacker who controls DNS can damage deliverability and impersonate the business even after the website is repaired.
Compare DNS at HostGator with the registrar and remove unknown A, AAAA, CNAME, MX, TXT or nameserver entries. Check for unauthorised redirects and domain-transfer locks. Australian brands often rely on .com.au or .au domains, so verify auDA eligibility requirements, registrant details and nameservers before approving any transfer. Reset domain or nameserver access from the registrar’s secure portal.
Restore trust and monitor recovery
After removing files and database records, run more than one scan. Use HostGator’s security tools or SiteLock if included with the plan, a reputable URL scanner, and a manual review of the directories that triggered alerts. Scanners can miss dormant web shells, so keep watching file timestamps, new cron jobs and access logs for at least several weeks.
Harden the restored account. Use SFTP where possible, separate FTP accounts, least-privilege access, multifactor authentication, HTTPS and a host firewall or web application firewall. Disable directory listing and XML-RPC when the application does not need them, rate-limit login attempts and give each contractor a separate account. Remove default usernames and shared credentials.
Monitor the domain, cPanel, mail and Search Console rather than relying on a one-time cleanup alert. The Australian Cyber Security Centre and Scamwatch publish relevant malware and phishing warnings, which can help identify campaigns targeting local customers. If users received fake invoices or login prompts, preserve the message headers, stop further sending and issue a factual warning through the business’s established channels.
Recover search visibility safely
Search recovery begins only after malicious code is gone. In Search Console, inspect affected URLs, check security or manual-action notices, remove stale sitemap entries and request a review when the warning has been resolved. Clear CDN and page caches so visitors cannot receive an old infected response. Watch indexed pages for several weeks because search engines may recrawl old URLs.
If a legitimate page must move, preserve its signals with a permanent redirect. The HostGator 301 redirect guide explains the setup in cPanel or .htaccess. Redirect only to the closest relevant replacement, avoid chains and loops, and keep the old address working while backlinks and search traffic settle. Do not redirect an infected page until its destination is verified clean.
Ask owners of legitimate external pages to remove links that point to malware or spam URLs. Reserve Google’s disavow tool for confirmed, persistent link schemes; it cannot remove a harmful page or repair the server itself. Keep the site’s Australian market settings, local citations and Search Console country signals accurate, because credible local links and consistent listings are more useful than bulk backlink cleanup.
Keep clean hosting recoverable
Make prevention routine. Apply tested updates on a schedule, use staging for major changes, and keep automated, off-account backups with a tested restore process. Follow the 3-2-1 rule: three copies, two media types and one copy outside HostGator. Review administrator accounts, email users, DNS, domains, SSL certificates and renewals on a fixed schedule, assigning each check to a named owner.
Use HostGator’s cPanel, billing and invoice tools for routine account checks, and the knowledge base, tutorials, support tickets and community forums when an issue is unfamiliar. For an Australian business, keep hosting invoices, payment records and GST documentation in AUD so bookkeeping matches local practice. Review domain auto-renewal and transfer settings for .com.au and .au assets.
Keep an incident runbook containing clean administrator contacts, backup locations, DNS access, registrar details, Australian support hours and a list of files that must never be edited directly. Assign responsibility for reviewing alerts and testing restores. The key point to remember is simple: isolate the breach, preserve proof, remove persistence, repair every compromised access path, and restore only verified clean files.