WordPress Keeps Switching HTTPS Back to HTTP: Causes and Fixes

Quick Answer: How does WordPress HTTPS switching work? WordPress HTTPS switching works by applying a defined WordPress, server, or browser-level process to a specific site problem. The correct fix depends on the active stack, the exact symptom, and the evidence produced by settings, code, logs, headers, or a repeatable test.

WordPress HTTPS switching a comparable WordPress alternative
Directly addresses the primary problem or decision in this article. Uses a different workflow, product, or trade-off for a related outcome.
Best when its control, compatibility, maintenance, and evidence fit the site. Best when simplicity, portability, performance, or another project constraint matters more.

Use WordPress HTTPS switching when the reader has a specific goal

Start with the outcome the reader wants, not with a feature list. For WordPress HTTPS switching, identify the page, audience, workflow, or decision involved, then check the active theme, plugins, hosting, mobile experience, analytics, and caching before changing production settings.

Record the current state and test one representative example first. This makes the result easier to verify and gives you a defensible rollback point if the change affects visitors, search visibility, forms, or revenue.

Use WordPress HTTPS switching to compare the practical tradeoffs

The closest alternative is a comparable WordPress alternative, but the right choice depends on the job rather than brand familiarity. Compare control, compatibility, accessibility, performance, support, exportability, security, recurring maintenance, and the cost of changing direction later.

A professional decision names who should use the option, who should avoid it, and what evidence would change the recommendation. That is more useful than calling one tool the universal winner.

Use WordPress HTTPS switching and verify the result

After applying the advice, test the same public URL or workflow as the same type of visitor who reported the issue. Check desktop and mobile layouts, browser console errors, forms, login, search, and any cache or redirect headers relevant to the topic.

Do not treat a successful dashboard action as proof that the public experience is correct. Keep a short change note with the date, versions, URLs tested, result, and rollback path.

Technical example: verify WordPress HTTPS settings

Check the application-level URLs before changing redirects. The two values should normally use the same HTTPS host, and constants in wp-config.php can override the dashboard.

wp-config.php example

define('WP_HOME', 'https://example.com');
define('WP_SITEURL', 'https://example.com');

Replace the example domain with the real canonical domain. Back up first, test the login and public pages, and do not add these constants if the deployment already manages the values elsewhere.

Laptop showing website security and HTTPS protection concepts

A WordPress site can have a valid SSL certificate and still generate HTTP links. That feels absurd until you separate three different things: whether HTTPS is available, whether the visitor is being forced to use HTTPS, and whether WordPress knows its own canonical site URL should be HTTPS. Those are related, but they are not the same setting.

Why WordPress can prefer HTTP even when SSL works

WordPress builds internal URLs from `home_url()`, `site_url()`, database options, constants, rewrite behavior, and sometimes proxy headers supplied by the host or CDN. If any of those still say `http://`, WordPress may save, display, or redirect to the insecure version even though the certificate itself is valid.

This often happens after a host migration, a staging push, a manual database import, a Cloudflare setup, or a one-click installer that originally ran over HTTP. The certificate can be correct while the application layer still believes HTTP is the source of truth.

Start with the two WordPress URL settings

Go to Settings > General and check both WordPress Address and Site Address. They should usually use the same HTTPS domain. If one is HTTP and the other is HTTPS, WordPress may behave inconsistently. If the fields are greyed out, constants in wp-config.php are probably overriding them.

Do not guess from the address bar alone. The browser may show HTTPS because a redirect or CDN rule is active, while WordPress still stores HTTP internally. That mismatch is exactly what creates mixed content, weird editor links, bad canonical URLs, and cache confusion.

  1. Open Settings > General.
  2. Confirm WordPress Address uses https://.
  3. Confirm Site Address uses https://.
  4. Save changes only when you know the HTTPS version loads correctly.
  5. Log back in if WordPress redirects you after the change.

Check wp-config.php constants

Many difficult HTTPS issues come from constants such as `WP_HOME` and `WP_SITEURL`. These constants override database settings. That can be useful for controlled deployments, but confusing when a site owner changes Settings > General and nothing really changes.

If constants exist and point to HTTP, WordPress will keep believing HTTP is canonical. If constants point to HTTPS but the database says HTTP, the admin screens may appear to disagree with permalinks, editor previews, or generated links. Pick one source of truth and document it.

Really Simple Security WordPress plugin screenshot showing SSL and security onboarding
SSL/security plugin screenshots are useful, but the canonical URL source may still live in WordPress settings or wp-config.php.

Search-replace old content URLs carefully

Older posts, images, shortcodes, widgets, and page builder data may contain hard-coded HTTP URLs. Changing the site URL does not always rewrite every stored content reference. WordPress has improved HTTPS migration handling, but older content and plugin-specific storage still need careful review.

Use a reliable search-replace tool on staging when possible. Replace `http://example.com` with `https://example.com`, not every instance of `http://`, because external links may legitimately remain HTTP. Always back up first.

  • Post content and excerpts.
  • Post meta used by page builders.
  • Widgets and menus.
  • Theme options.
  • Serialized plugin settings.
  • Image URLs in CSS or custom HTML.

Proxy and Cloudflare complications

If Cloudflare, a load balancer, or another reverse proxy terminates HTTPS before the request reaches WordPress, the origin server may see the request as HTTP. WordPress then generates HTTP URLs unless the host passes the correct forwarded protocol headers and WordPress recognizes them.

This is a classic cause of redirect loops and mixed content after enabling a CDN. The browser is secure to Cloudflare, but the origin connection or header detection is misconfigured. Fix the proxy configuration rather than adding random redirect plugins on top.

Redirects, HSTS, and cache

A proper HTTPS migration needs a single clear redirect from HTTP to HTTPS. Redirects can live in Apache, Nginx, the host control panel, Cloudflare, or a plugin. Running several redirect systems at once can cause loops, slow chains, and inconsistent cache keys.

If HSTS has been sent, browsers may force HTTPS even after server rules change. That can hide the real state during testing. Use a fresh browser profile, command-line header checks, or external testing tools when you need to see what the server actually returns.

Code editor used for WordPress HTTPS troubleshooting
Code-level checks are useful when WordPress settings, server redirects, and CDN behavior disagree.

Cache-aware verification

After fixing HTTPS settings, purge every relevant layer: WordPress page cache, server cache, CDN cache, object cache if needed, and browser cache. Old cached HTML can continue referencing HTTP assets long after the database is fixed.

Test a public post, the homepage, an image attachment, the login page, and one admin URL. The goal is not only a padlock. The goal is clean canonical URLs, no mixed-content warnings, one redirect, and stable cache behavior.

Test Healthy result
HTTP homepage 301 or 308 redirect to HTTPS in one step
HTTPS homepage 200 response, canonical HTTPS URL
Public post No mixed-content warnings
Admin login HTTPS and no redirect loop
Second logged-out request Cache HIT if public page cache is enabled

Final recommendation

Fix WordPress HTTPS problems from the inside out: canonical settings, constants, database URLs, proxy headers, redirects, then cache. If you start with random plugins, you may hide the symptom while leaving the wrong source of truth in place.