How to Enable HTTPS on WordPress: Mixed Content Fix, HSTS Headers & Really Simple SSL Guide (2026)
The HTTPS switch breaks more WordPress sites than people expect. This guide covers the full fix: SSL install, mixed content repair, Really Simple SSL plugin config, HSTS headers, and the wp-config.php override for stubborn redirect loops.
Switching from HTTP to HTTPS is mandatory in 2026. HTTPS encrypts data between your visitor's browser and your server, protects user privacy, and is a ranking factor in Google Search. Chrome marks HTTP sites as "Not Secure" โ a trust killer.
Why HTTPS Matters
- Security: Encrypts login credentials, form submissions, and payment data
- Trust: Green padlock (or no warning) vs "Not Secure" warning
- SEO: Google has used HTTPS as a ranking signal since 2014
- Speed: HTTP/2 (faster protocol) is only available over HTTPS
- Browser requirements: Many modern browser features require HTTPS
Step 1: Install SSL Certificate
Most hosts provide free SSL via Let's Encrypt. Check your specific host:
Hostinger:
- Log in to hPanel โ Websites โ Manage
- Go to Security โ SSL
- Under Install SSL Certificate, click Install next to your domain
- Wait 5โ10 minutes for installation
Bluehost/HostGator (cPanel):
- Log in to cPanel โ Security โ SSL/TLS
- Click Manage SSL Sites
- Click AutoSSL or install Let's Encrypt from the interface
Cloudways:
- Application Management โ SSL Certificate
- Choose Let's Encrypt
- Enter your domain(s) and click Install Certificate
SiteGround:
- Site Tools โ Security โ SSL Manager
- SSL is auto-installed โ if not, click the Let's Encrypt option
WP Engine / Kinsta: SSL is provisioned automatically when you add a domain. No manual setup needed.
If your host doesn't include free SSL: Use Cloudflare's free plan โ it provides SSL at the CDN level, meaning your site has HTTPS even without a certificate at the origin (use "Flexible" mode only as temporary solution).
Step 2: Update WordPress URLs to HTTPS
After SSL is installed, update WordPress's URL settings.
Method A โ WordPress Settings (easiest):
- Log in to WordPress admin at
http://yourdomain.com/wp-admin - Go to Settings โ General
- Change WordPress Address (URL) from
http://tohttps:// - Change Site Address (URL) from
http://tohttps:// - Click Save Changes
- WordPress will log you out โ log back in at
https://yourdomain.com/wp-admin
Method B โ wp-config.php (if you can't access admin):
Add to wp-config.php before /* That's all, stop editing! */:
define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );
Step 3: Force HTTPS Redirects
Ensure all HTTP traffic automatically redirects to HTTPS.
Method A โ .htaccess (Apache servers):
Add this at the top of your .htaccess file (above WordPress rules):
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Method B โ Nginx config (for Nginx servers like Cloudways): Ask your host to add this to the Nginx configuration (usually managed by your host):
server {
listen 80;
server_name yourdomain.com www.yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
On Cloudways, this is done via Application Settings โ SSL Certificate โ Force HTTPS Redirection toggle.
Method C โ Cloudflare: In Cloudflare dashboard โ SSL/TLS โ Edge Certificates โ Toggle Always Use HTTPS ON.
Method D โ Really Simple SSL Plugin:
- Install Really Simple SSL plugin
- Activate โ it automatically detects your SSL and updates
.htaccess - Click Go ahead, activate SSL!
This is the easiest one-click solution for beginners.
Step 4: Fix Mixed Content Warnings
After switching to HTTPS, some page elements may still load over HTTP (images, scripts, CSS from old URLs). This causes a "mixed content" warning โ the padlock shows a warning symbol.
Identify mixed content:
- Open Chrome DevTools (F12) โ Console tab
- Look for errors like:
Mixed Content: The page at 'https://...' was loaded over HTTPS, but requested an insecure resource 'http://...'
Fix Method 1 โ Really Simple SSL (automatic): The Really Simple SSL plugin automatically rewrites HTTP to HTTPS in WordPress output. Install it and most mixed content issues resolve without manual work.
Fix Method 2 โ Better Search Replace (database):
- Install Better Search Replace plugin
- In the Search field, enter
http://yourdomain.com - In the Replace field, enter
https://yourdomain.com - Select all tables
- Uncheck Run as dry run? and click Run Search/Replace
This updates all stored URLs in your database from HTTP to HTTPS.
Fix Method 3 โ Manual hardcoded links:
Some theme files may have hardcoded http:// URLs. Use the Search and Replace tool to find them in your codebase, or use a child theme to override the specific template.
Step 5: Update wp-config.php Security Keys
After migrating to HTTPS, regenerate your WordPress security keys. This logs out all users and forces re-authentication over HTTPS:
- Visit api.wordpress.org/secret-key/1.1/salt/
- Copy the generated keys
- Replace the existing key definitions in
wp-config.php
Step 6: Verify HTTPS is Working
Check SSL certificate:
- Visit your site โ look for the padlock icon in the browser address bar
- Click the padlock โ Certificate to verify it's valid and for your domain
- Check expiry date (Let's Encrypt certificates expire every 90 days โ auto-renewal should handle this)
Check redirects:
- Type
http://yourdomain.comin your browser - It should automatically redirect to
https://yourdomain.com(permanent 301 redirect)
Check mixed content:
- Open Chrome DevTools โ Console
- No mixed content warnings should appear on any page
Check SSL certificate quality: Visit SSL Labs SSL Test and enter your domain. You should score A or A+.
Update Google Search Console
After switching to HTTPS:
- Add
https://yourdomain.comas a new property in Google Search Console - Submit your HTTPS sitemap
- Request re-indexing of your homepage
Google will eventually discover the redirects, but submitting directly to Search Console speeds up re-indexing of your HTTPS pages.
Common HTTPS Migration Issues
Site shows security warning after SSL install:
Check that your SSL certificate covers both yourdomain.com and www.yourdomain.com. Let's Encrypt allows both โ ensure both variants are included in the certificate.
Infinite redirect loop: Usually caused by Cloudflare Flexible SSL mode when WordPress also forces HTTPS. Set Cloudflare to Full (Strict) mode and ensure origin has a valid SSL certificate.
Admin dashboard redirecting to login repeatedly:
Update WP_HOME and WP_SITEURL in wp-config.php to use https://. Clear cookies and try again.
Email links still use HTTP: Check WooCommerce email settings and other plugins that generate URLs. Update their base URL settings to use HTTPS.
WordPress HSTS: The Next Level of HTTPS Security
HSTS (HTTP Strict Transport Security) tells browsers to ONLY connect via HTTPS โ even if someone types http:// manually. Once set, visitors can never access the HTTP version (until HSTS expires).
Add HSTS headers in .htaccess:
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</IfModule>
Or via PHP in WordPress (functions.php or plugin):
add_action( 'send_headers', function() {
if ( ! headers_sent() && is_ssl() ) {
header( 'Strict-Transport-Security: max-age=31536000; includeSubDomains; preload' );
}
});
Really Simple SSL Pro adds HSTS headers via its security headers module โ no code required.
Important: Before enabling HSTS, make sure all subdomains have valid SSL (includeSubDomains). If any subdomain lacks SSL, HSTS will break it. Test with max-age=300 (5 minutes) first, then increase to 31536000 (1 year).
WordPress-Specific SSL Issues Diagnostic Table
| Symptom | Cause | Fix |
|---|---|---|
| Padlock shows warning | Mixed content (HTTP resources on HTTPS page) | Really Simple SSL + Better Search Replace |
| Infinite redirect loop | Cloudflare Flexible SSL + WordPress forcing HTTPS | Set Cloudflare to Full (Strict) mode |
| Admin redirects to login repeatedly | WP_HOME/WP_SITEURL mismatch | Update both in wp-config.php |
| Images broken after SSL switch | Hardcoded HTTP image URLs in database | Better Search Replace for http://yourdomain.com |
| SSL error on wp-login.php only | Cookie settings using wrong domain | Check COOKIE_DOMAIN in wp-config.php |
| Third-party plugin loading HTTP script | Plugin has hardcoded HTTP URL | Contact plugin developer or add filter to rewrite |
| SSL works but search results show HTTP | Old sitemap cached | Regenerate sitemap, resubmit to Search Console |
| Let's Encrypt not auto-renewing | Cron job not running | Install WP Crontrol, check wp_cron is functional |
Really Simple SSL Plugin: Full Configuration Guide
Really Simple SSL is the most popular WordPress HTTPS plugin with 5M+ active installs. Here's the complete setup:
Free Version Setup
- Install & activate Really Simple SSL
- Backup your site first (REQUIRED โ this is a significant change)
- Click Go ahead, activate SSL!
- The plugin will:
- Update
WP_HOMEandWP_SITEURL - Add HTTPS redirect to
.htaccess - Fix mixed content in real-time via output buffering
- Update
- Test every page type (home, post, page, contact, WooCommerce)
Really Simple SSL Configuration Options
| Setting | Default | When to Change |
|---|---|---|
| Force HTTPS | On | Never off for production sites |
| Mixed content fixer | On | Can turn off if it causes layout issues |
| HTTP Strict Transport Security | Off | Enable once all pages test clean |
| Site Health | On | Keep on โ alerts to SSL issues |
| Cache headers | Off | Enable for performance (adds cache-control headers) |
Known Really Simple SSL Conflicts
| Plugin | Conflict | Solution |
|---|---|---|
| WP Rocket | Output buffer conflict | Disable mixed content fixer in Really Simple SSL (WP Rocket handles it) |
| Cloudflare plugin | Duplicate redirects | Ensure only one forces HTTPS โ disable in one |
| Elementor | Occasionally breaks | Regenerate CSS after SSL switch in Elementor settings |
| Divi Builder | Cached HTTP styles | Purge Divi static CSS after switching |
Choosing a host with automatic SSL? Hostinger, Cloudways, and Kinsta all auto-provision and auto-renew SSL certificates for every domain you add.
The HostPro Reviews Editorial Team researches hosting, software, and online services using publicly available product documentation, published pricing, and third-party sources where cited. Where an article draws on first-hand experience or an outside benchmark, it says so. Articles are updated when products or terms materially change.
View all articles โFree Download
2026 Web Hosting Comparison Cheat Sheet
- โCompare hosting features, pricing and use cases
- โRenewal price traps to avoid
- โBest host for WordPress, WooCommerce & agencies
- โWhere to check current hosting offers
Free ยท Unsubscribe anytime