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.