Fix guide · WordPress
How to Fix www / non-www Redirect Issues in WordPress (2026)
If your site responds to both https://example.com and https://www.example.com without redirecting one to the other, Google can see them as two separate sites and split your ranking signals. This is one of the most common technical SEO problems on WordPress sites. The fix is two steps: tell WordPress which URL is canonical, then redirect the other version at the server level.
Why it matters
What this issue costs you
Search engines see www.example.com and example.com as different hosts. If both resolve without a redirect, inbound links may point to either version, splitting your link equity. Google recommends picking one as the canonical domain and permanently redirecting the other.
Step-by-step
How to fix: www / non-www inconsistency
WordPress
- 1
Step 1: Set the canonical URL in WordPress Settings
Go to WordPress Dashboard → Settings → General. Set both "WordPress Address (URL)" and "Site Address (URL)" to your preferred domain — either with www (https://www.example.com) or without (https://example.com). Use exactly the same value in both fields. Save. This controls what WordPress uses in its own links and canonical tags.
- 2
Step 2: Add a redirect in .htaccess (Apache)
If your server runs Apache (most shared hosting), open your .htaccess file (root of your WordPress install). Add the redirect block ABOVE the WordPress rewrite rules. Choose the version that matches your WordPress Settings from Step 1.
.htaccess# Redirect www → non-www RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L] # --- OR — Redirect non-www → www RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] - 3
Step 2 (alternative): Redirect in Nginx
If your server runs Nginx, add a server block for the non-preferred domain that redirects to the canonical one:
nginx.conf# Redirect www → non-www server { listen 443 ssl; server_name www.example.com; return 301 https://example.com$request_uri; } - 4
Step 3: Confirm the redirect
Use a redirect checker or curl to confirm the non-preferred domain returns HTTP 301 pointing to the canonical version. Then update your Google Search Console property if needed — GSC treats www and non-www as separate properties.
Verify the fix
Run the checker to confirm the issue is resolved
After applying the steps above, paste your URL below. Our checker will re-run every applicable check and show whether www / non-www inconsistency still shows as a failing check.
FAQ
Common questions about www / non-www inconsistency
www or non-www — which should I pick?
It doesn't matter for SEO. Pick whichever you prefer (many modern sites use non-www for brevity) and stick with it. Consistency is what matters, not which version you choose.
Will changing my canonical domain hurt my rankings?
A correctly implemented 301 redirect passes nearly all link equity to the canonical domain. There may be a very brief ranking fluctuation while Google re-processes the redirect, but this typically resolves within days.
Do I need to update Google Search Console?
Yes. Add both www and non-www versions as separate properties in GSC and use the "Change of Address" tool if you are switching. GSC also lets you set a preferred domain.
While you're here
Related fix guides for WordPress
Need a full audit?
This checker spots individual issues instantly. deepseoanalysis.com crawls your whole site and tracks changes weekly, from $24/mo.
See all WordPress fix guides, or run a free check now.