Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy
Wordpress

WordPress: Fix a Mixed-Content Warning That Appears Right After Moving to HTTPS

- 26.09.26 - ErcanOPAK

📝 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.

— WordPress Admin

Related posts:

WordPress: Change Database Prefix for Security

WordPress: Change Database Prefix for Security

WordPress: Recover From a White Screen After Increasing the PHP Memory Limit Didn't Help

WordPress: Recover From a White Screen After Increasing the PHP Memory Limit Didn't Help

WordPress: Use WP-CLI to Manage WordPress from Command Line

WordPress: Use WP-CLI to Manage WordPress from Command Line

Views: 4

Post navigation

Ajax: Fix a Type-Ahead Search Box That Fires a New Request on Every Single Keystroke
JavaScript: Why Object.freeze() Doesn’t Stop Nested Properties From Being Changed

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (608)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (546)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (980)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (857)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com