🔹 Quick Fix: If your WordPress site has both http://
and https://
in the canonical URL, go to Settings → General in your WordPress dashboard and ensure both the “WordPress Address (URL)” and “Site Address (URL)” are set to https://
.
Then, check your SEO plugin settings (like Yoast SEO) and ensure the canonical URL is correct. Finally, force HTTPS using a simple redirect in your .htaccess
file:
apacheRewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/\ [R=301,L]
Save it, clear your cache, and your issue should be fixed!
Now, let’s break this down in detail.
Why Is This Happening?
Seeing both http://
and https://
in your canonical URL means your website is sending mixed signals to search engines, which can hurt SEO rankings. Here’s why it happens:
1. Your WordPress Settings Are Misconfigured
If WordPress is still using http://
instead of https://
, it might generate the wrong canonical tag.
✅ Fix:
- Go to WordPress Dashboard → Settings → General
- Ensure both “WordPress Address (URL)” and “Site Address (URL)” are set to
https://
2. Your SEO Plugin Is Adding the Wrong Canonical Tag
Plugins like Yoast SEO, Rank Math, or All in One SEO manage canonical URLs but may be misconfigured.
✅ Fix:
- Open Yoast SEO → Search Appearance → Advanced
- Ensure the Canonical URL field is set to
https://yourwebsite.com
- Save changes and clear cache
3. Your Website Has HTTP and HTTPS Versions Indexed
Google might be seeing two versions of your website because of incomplete redirects.
✅ Fix: Redirect all http://
traffic to https://
using .htaccess:
- Open your .htaccess file via FTP or your hosting panel.
- Add this rule at the top:
apacheCopyEditRewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/\ [R=301,L]
- Save the file and clear your website’s cache.
4. Your Theme or Plugins Have Hardcoded HTTP URLs
Some themes or plugins might be inserting the wrong canonical URL directly into your website’s code.
✅ Fix:
- Open your header.php file in your theme editor.
- Look for this line:htmlCopyEdit
<link rel="canonical" href="http://yourwebsite.com">
- Change it to:htmlCopyEdit
<link rel="canonical" href="https://yourwebsite.com">
- Save changes and clear your cache.
5. Cloudflare or CDN Settings Are Overriding Your Canonical URL
If you’re using Cloudflare or a CDN, it may be serving both HTTP and HTTPS versions of your site.
✅ Fix:
- Go to your Cloudflare dashboard → SSL/TLS settings
- Turn on “Always Use HTTPS”
- Enable Automatic HTTPS Rewrites
Why This Fix Matters for SEO & Website Performance
If search engines see both HTTP and HTTPS versions of your site, it can cause:
❌ Duplicate content penalties (Google might split rankings between two versions)
❌ Lower search rankings (Google gets confused about which version to prioritize)
❌ Security warnings (Users may see “Not Secure” messages in browsers)
By fixing your canonical URL, you ensure Google indexes the right version, improve security, and boost your SEO rankings.
Final Steps: Verify Your Fix
After applying the fixes, test your site with these tools:
✔ Google Search Console → Check for canonical errors
✔ Screaming Frog SEO Spider → Scan your canonical tags
✔ WhyNoPadlock.com → Detect mixed content issues
✔ Ahrefs/Semrush SEO Audit → Ensure only https://
URLs are indexed
Conclusion: Keep Your WordPress Site Clean & SEO-Friendly
Your website’s canonical URL should always be https://
. Fixing this issue ensures strong SEO, better security, and a professional user experience.
🚀 Quick Recap of Fixes:
✔ Update WordPress settings to use https://
✔ Fix canonical URLs in SEO plugins
✔ Force HTTPS via .htaccess redirect
✔ Remove hardcoded HTTP references from theme files
✔ Enable HTTPS in Cloudflare or your CDN
Want expert help? Contact Mun Web Design for professional WordPress development and SEO fixes. Let’s make your website fast, secure, and search-engine-friendly! 🚀