A WordPress redirect can come from DNS, a CDN edge rule, the origin server, or WordPress malware. Compare the same URL at each delivery layer before editing .htaccess, changing DNS, or clearing evidence.
I’m Ryohei Yokoyama, founder of SiteFixNow. With over 20 years of IT engineering and practical WordPress recovery experience, I separate DNS, CDN, origin, and application evidence so cleanup targets the layer that produced the redirect.
- How to distinguish DNS or registrar compromise from WordPress redirect malware.
- How to compare public DNS, CDN responses, and the confirmed origin without changing production first.
- Which headers, logs, files, and WordPress settings identify the redirecting layer.
- How to recover accounts and content in the right order, then verify every path.
WordPress DNS Hijack and Redirect Malware Produce Different Evidence
Classify the redirect by the first layer that changes the destination: DNS answer, CDN response, origin response, or WordPress execution.
DNS maps a hostname to infrastructure; it does not normally return an HTTP Location header. A hijack begins with an unexpected delegation or address that sends visitors to infrastructure the owner did not approve.
Origin redirects come from the web server, hosting configuration, or application at the real server. WordPress causes include altered options, injected code, compromised components, or database payloads; the .htaccess malware guide covers only one mechanism.
WordPress DNS Hijack Checks Start With Authoritative Records
Record delegation and answers from independent resolvers before editing a zone, flushing caches, or changing nameservers.
Compare the registrar’s nameservers with authoritative delegation, then query A, AAAA, and CNAME through two independent resolvers. Save timestamps, TTLs, resolver names, and the approved change record because planned migrations can temporarily differ.
Before repair, preserve the zone export, registrar and DNS audit logs, account users, tokens, nameserver changes, and DNSSEC state. If delegation is wrong, edits inside the former DNS provider may have no effect.
# Replace example.com; save the time and resolver used.
dig +short NS example.com
dig +noall +answer A example.com @1.1.1.1
dig +noall +answer AAAA example.com @8.8.8.8
dig +noall +answer CNAME www.example.com @1.1.1.1
dig +trace example.comWordPress CDN and Origin Tests Must Use the Same Hostname
Compare the public route with the confirmed origin while preserving the hostname and TLS name; an IP-only test can hit the wrong virtual host.
Test the origin only after its owner confirms the address. curl --resolve changes resolution for one request while retaining the hostname for TLS and HTTP; never use an unverified historical address or violate origin-access policy.
If the public route redirects but the origin does not, inspect edge rules, workers, routing, and cache state. If both redirect identically, inspect origin logs and WordPress; the cache malware workflow explains why purging first can hide evidence.
# Public route; do not follow the redirect yet.
curl -sS -o /dev/null -D - https://example.com/affected-path
# Confirmed origin only, with owner authorization.
curl -sS -o /dev/null -D - \
--resolve example.com:443:192.0.2.10 \
https://example.com/affected-path
WordPress Redirect Malware Evidence Appears at the Origin or Application
When the origin reproduces the redirect, trace server configuration and WordPress instead of assuming DNS remains responsible.
Verify WordPress home and siteurl through an authenticated route and compare them with wp-config.php. WordPress distinguishes Site Address from WordPress Address, and a wrong value can cause a legitimate loop or an attacker-controlled redirect.
Reproduce conditional redirects for logged-out, mobile, referrer, country, and first-visit cases in an isolated matrix. Use the mobile redirect guide and the files and database checklist for the affected layer.
wp option get home
wp option get siteurl
wp config get WP_HOME
wp config get WP_SITEURL
rg -n 'bad-domain\.example|wp_redirect|wp_safe_redirect' \
wp-config.php .htaccess wp-content/themes wp-content/plugins wp-content/mu-pluginsWordPress DNS Hijack Recovery Must Secure Accounts Before Content
Recover the controlling account for the affected layer, preserve its history, then restore approved configuration and clean WordPress where evidence requires it.
For registrar or DNS compromise, recover the provider account, secure its email, remove unauthorized users and tokens, rotate credentials, and restore approved delegation. Enable MFA and configure DNSSEC only after the registrar and DNS provider agree.
For WordPress compromise, replace altered components from trusted sources, repair targeted database values, remove unauthorized users or tasks, patch the entry point, and rotate relevant credentials. Changing DNS alone does not clean an infected origin.
If redirects return, stop repeating deletion. Follow the reinfection root-cause workflow to find a surviving writer, stolen account, vulnerable component, or neighboring compromised site.
WordPress DNS Hijack Verification Requires a Four-Layer Matrix
Close the incident only when DNS, public CDN delivery, the confirmed origin, and WordPress match the approved state across relevant conditions.
After the expected TTL, requery delegation and records through independent resolvers. Confirm registrar nameservers, authoritative answers, DNSSEC where enabled, IPv4 and IPv6 routes, and the absence of unauthorized users, tokens, forwarding, or transfer requests.
Repeat public and origin tests for the home page, affected path, login, and a static asset. Compare status, Location, certificate name, cache indicators, logs, clean profiles, mobile conditions, and the original targeting trigger.
Confirm WordPress URL settings, file baseline, database findings, users, tasks, security keys, and patched components. Monitor DNS, CDN rules, files, outbound requests, and privileged logins through the recurrence period; one clean refresh is not proof.
WordPress DNS Hijack vs Redirect Malware FAQ
Use the first layer that changes the result to decide where evidence collection and recovery should begin.
WordPress DNS Hijack or Redirect Malware Is Solved by Layered Evidence
Preserve the route, compare DNS, CDN, origin, and WordPress, repair the controlling account or writer, and verify the complete path.
A redirect is a symptom, not a location. Keep the hostname and path constant while comparing each layer, then repair the registrar, DNS, CDN, origin, or WordPress system that changed the result.
If You Can’t Secure or Recover Your WordPress Site Yourself

If your website shows malware warnings, redirects to strange pages, or you are not sure whether it is secure,
SiteFixNow can help clean, repair, and recover your WordPress site.
- Your WordPress site may be infected with malware.
- Security warnings appear in Google or browser results.
- You found unknown admin users or suspicious files.
- The site redirects to spam or unknown websites.
- You need urgent WordPress hacked site repair.
- Reduce visitor risk and SEO damage.
- Find hidden malware and backdoors, not only visible symptoms.
- Recover the site safely without unnecessary data loss.
