Why my wordpress website includes both http://https:// on canonical url?

Why my wordpress website includes both httphttps on canonical url

🔹 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:

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:

  1. Go to WordPress Dashboard → Settings → General
  2. 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 SEOSearch AppearanceAdvanced
  • 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:

  1. Open your .htaccess file via FTP or your hosting panel.
  2. Add this rule at the top:
apacheCopyEditRewriteEngine On  
RewriteCond %{HTTPS} !=on  
RewriteRule ^(.*)$ https://%{HTTP_HOST}/\ [R=301,L]  
  1. 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:

  1. Open your header.php file in your theme editor.
  2. Look for this line:htmlCopyEdit<link rel="canonical" href="http://yourwebsite.com">
  3. Change it to:htmlCopyEdit<link rel="canonical" href="https://yourwebsite.com">
  4. 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 dashboardSSL/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! 🚀

Leave a Reply

yellow_noun-waning-crescent-moon-1
yellow_noun-three-quartet-half-moon-2
yellow_noun-moon-3
MUN Web Design
MUN Web Design
MUN Web Design
MUN Web Design
MUN Web Design
MUN Web Design

Helping small business service providers and coaches improve online visibility with elegant and conversion-driven websites.

Increase Trust | Increase Engagement | Increase Leads

3 Steps to success

Increase Trust

Increase Engagement

Increase Leads

noun-waning-crescent-moon-1

Visual Identity

noun-three-quartet-half-moon-2

Web Design/Build

noun-moon-3

Launch

How to get started

/01 Inquire

Take the first step by filling out a brief inquiry form to share more about your business, your website vision and requirements. 

/02 Book your spot

Following filling out the inquiry we can chat via text or video and after our chat I’ll send you a proposal and an invitation to secure your project spot. I want to make sure we’re on the same page and excited to bring your vision to life!

Make things happen today.