📝 The Padlock Disappeared the Moment You Went HTTPS
Moving a WordPress site to HTTPS and updating the site URL in Settings feels like the whole job – but the browser still shows a broken padlock or a ‘Not Secure’ warning, because dozens (sometimes hundreds) of images, scripts, and stylesheets referenced with hardcoded `http://` URLs are still baked directly into old post content and theme settings, and the browser blocks or flags every one of them.
🔎 The Problem
Browser console: Mixed Content: The page at '"'"'https://yoursite.com/blog-post'"'"' was loaded over HTTPS, but requested an insecure image '"'"'http://yoursite.com/wp-content/uploads/2019/03/photo.jpg'"'"'. This content should also be served over HTTPS. # Updating "WordPress Address" and "Site Address" in Settings > General # only changes what URL WordPress GENERATES going forward - it does # nothing to the literal http:// URLs already stored inside old post # content, widget text, and theme customizer settings from before the # switch.
✅ Fix: Rewrite the Old URLs, Don’t Just Change the Setting
- A search-and-replace plugin (Better Search Replace, or the WP-CLI command `wp search-replace ‘http://yoursite.com’ ‘https://yoursite.com’`) rewrites every stored `http://` reference across posts, postmeta, and options tables in one pass – far more thorough than manually editing individual posts one at a time.
- Browser DevTools’ Console tab (or the Network tab filtered to blocked requests) lists every specific mixed-content URL still being requested insecurely on a given page – working through that list confirms exactly which asset types (images, embedded scripts, iframe sources) still need fixing after the bulk replace.
- A dedicated plugin (like SSL Insecure Content Fixer) can patch remaining mixed-content references on the fly for content missed by the bulk replace – useful as a safety net, though fixing the stored data directly is the more permanent solution.
⚠️ Why a Full Backup Matters Before This Step
- A raw database search-and-replace can corrupt PHP-serialized data if it isn’t length-aware (widget settings, theme customizer options, and some plugin settings all store data as serialized arrays where changing string length without updating the stored length breaks the serialization) – using a WordPress-aware tool rather than a generic SQL replace avoids this specific failure mode.
- Taking a full database backup immediately before running any bulk replace means an interrupted or partially-failed replace (a timeout on a very large database) can be rolled back cleanly instead of leaving the site in a half-updated state.
Switching to HTTPS changes what WordPress writes from now on – it does nothing to what was already written before, and that’s exactly what the browser is still complaining about.

