How to Force HTTPS in WordPress
Make WordPress load only with HTTPS by fixing site URLs and redirect rules properly.
Before you start
Step-by-step instructions
1. Check that HTTPS already works on the domain
Before changing WordPress, open the HTTPS version of the domain directly in the browser and confirm it loads with a valid certificate.
The browser should open the site securely without certificate warnings. If HTTPS itself is not working yet, fix SSL first and only then continue with WordPress redirect setup.
2. Change WordPress site URLs to HTTPS
In WordPress admin, go to Settings → General and change both the WordPress Address (URL) and Site Address (URL) from HTTP to HTTPS.
Change http://example.com to https://example.com in both fields.
If these values remain on HTTP, WordPress may continue generating insecure internal links even after SSL is installed.
3. Force redirect from HTTP to HTTPS in .htaccess
Changing the WordPress URLs is not always enough. Add a redirect rule so every HTTP request is sent to HTTPS automatically.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Add this near the top of your existing .htaccess file, usually before the standard WordPress rewrite block.
4. Keep the normal WordPress rewrite block below it
Do not remove the normal WordPress rewrite section unless you have a specific reason. The HTTPS redirect rule should work alongside the standard WordPress block.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
This is the common structure when WordPress is running on Apache with .htaccess-based rewrites.
5. Clear cache and test different URLs again
After changing the settings and redirect rule, clear any cache that may still serve the old HTTP version.
Test the homepage, an inner page, a post URL, and both the HTTP and HTTPS versions directly in the browser.
Any HTTP request should redirect to the HTTPS version automatically and consistently.
6. Check mixed content if HTTPS still looks broken
If the page opens with HTTPS but still shows warnings, some resources may still be loading through HTTP.
Old image URLs, hard-coded script links, CSS background images, or plugin settings that still contain HTTP addresses.
Common situations this fixes
This usually means WordPress URLs or redirect rules are still incomplete.
Without a forced redirect, search engines and users may reach two versions of the same site.
This often happens when the WordPress URL settings are inconsistent with the actual SSL setup.
The redirect may be fixed, but mixed content may still exist inside the page output.
Common mistakes
If the certificate is missing or broken, the redirect only sends users into an error state faster.
In normal WordPress setups, both the WordPress Address and Site Address should be updated together.
A broken .htaccess file can make the site behave strangely or stop loading correctly.
Redirects solve HTTP access, but hard-coded HTTP resources inside content or settings may still need separate cleanup.
About this guide
This guide shows how to force HTTPS in WordPress when the site still opens with HTTP, redirects inconsistently, or shows mixed content after SSL installation. It focuses on the practical steps that actually fix the problem: checking WordPress URL settings, forcing redirects in .htaccess, and verifying that the site is loading securely.
How to follow this guide
- Confirm that SSL is already installed and working on the domain.
- Change the WordPress Address and Site Address to HTTPS.
- Add a redirect rule in .htaccess so HTTP always goes to HTTPS.
- Clear cache and test several URLs again.
- If some pages still load insecure resources, review mixed content separately.
Why use this method?
A site can have SSL installed and still continue loading through HTTP if WordPress settings or redirect rules are incomplete. Forcing HTTPS properly makes the site load consistently, improves security, and prevents confusion caused by mixed HTTP and HTTPS access.
Frequently Asked Questions
Can I force HTTPS before SSL is installed?
No. HTTPS redirect should only be forced after a valid SSL certificate is already working on the domain.
Why does WordPress still open with HTTP after SSL installation?
Usually the WordPress URL settings still use HTTP, or the server redirect rule has not been added yet.
What is mixed content?
It means the main page loads with HTTPS but some images, scripts, or other resources still load through HTTP.
Should I change both WordPress Address and Site Address?
Yes. In normal cases both should use the same HTTPS version of the site URL.