The WordPress redirect hack redirects your visitors (or Google) to spam, malware, or adult sites. Often invisible to you as the site owner — but visible to all visitors. It is one of the most damaging WordPress hacks for SEO and business reputation.
Most common causes we diagnose:
Systematic, fast, and safe process:
Check theme files, plugin files, and uploads for malicious PHP or JavaScript using grep -r "base64_decode" or a malware scanner.
Examine .htaccess for unauthorized RewriteRule or RedirectMatch directives that were not there before.
Run WP-CLI db search for redirect URLs and JavaScript in wp_options, wp_posts, and wp_usermeta tables.
Our WordPress expert responds in minutes.
Redirect hacks often target users based on user-agent (not logged-in admins), referrer (Google search clicks), or first visit cookies — so you as a logged-in admin may never see the redirect.
Typically 2-4 hours for a complete cleanup including all file types and database tables.
Three common methods: malicious JavaScript injected into theme header.php or footer.php; PHP redirect added to wp-config.php or .htaccess; or database injection of <script> tags into wp_options.siteurl or post content.
Smart attackers use 'cloaking' — they check the HTTP_REFERER header and only redirect if the visitor came from a search engine. This makes the hack harder to detect because admins visiting directly see no problem.
Same cloaking principle but checking User-Agent. Mobile users get the spam redirect; desktop sees the normal site. The attacker maximizes damage by targeting the larger mobile audience while staying invisible to desktop admins.
Indirectly. The hack itself redirects to spam/phishing sites that can steal data from your visitors. Your WordPress data isn't directly stolen by the redirect, but a compromised site is rarely doing only one thing — additional malware usually exists.
Yes, gradually. Once the hack is removed and Google re-crawls clean pages, rankings recover. Faster recovery: submit a Reconsideration Request via Search Console explaining the security incident has been resolved.
Because there's a backdoor (a hidden PHP file or admin user) that re-injects the malicious code automatically. We don't just remove the redirect — we find and remove every backdoor file and unauthorized account.
JavaScript redirects can be appended to .js files, hidden in EXIF data of JPEGs, or injected into CSS files via behavior expressions. We scan all file types, not just PHP.
Only if the redirect is in your active theme files. If the hack is in wp-config.php, plugins, or the database, switching themes does nothing. We do a comprehensive scan rather than rely on theme switches.
Very fast on shared hosting. We've seen attackers move from one infected site to all sibling sites within 1 hour via shared file system access. Multi-site cleanup is critical.
Sometimes. Wordfence, Sucuri, and MalCare detect known redirect patterns. New or sophisticated attacks often go undetected by automated tools — manual code review and behavioral analysis catch what scanners miss.
No. SSL only encrypts traffic in transit; it doesn't prevent server-side hacks. The redirect runs on YOUR server before SSL encryption — it's your site doing the redirect, with full SSL trust.
Yes — and very easily. With admin access, an attacker just installs a malicious plugin or edits theme files via the WP editor. We force password resets and check user_meta for active sessions to invalidate.
Browser caching means some visitors will continue seeing the redirect after the fix. We add no-cache headers temporarily, purge CDN, and monitor traffic patterns. Some businesses notify customers about the security incident as transparency.
WordPress site hacked? We clean it, close the backdoor, and secure it — same day.
Response in minutes. No data loss. No diagnosis charge.
wpfix.blimx.com