أهم النقاط
- Mixed content is http:// resources on an https:// page.
- The browser console lists every insecure URL.
- Use a serialisation-safe search and replace to update URLs in the database.
Mixed content happens when a page loaded over https:// pulls in images, scripts or stylesheets over plain http://. Browsers block insecure scripts outright and mark the page as not fully secure.
Find the insecure resources
- Open the page, press F12 and look at the Console. Each mixed-content warning lists the exact URL.
- Most come from hard-coded
http://links in content, theme settings or widgets.
Fix them
Update your site URL
In WordPress, set both addresses in Settings → General to https://.
Replace old URLs in the database
Posts and settings store full URLs. Use a search-and-replace tool that handles serialised data — for example WP-CLI:
wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid --dry-run
wp search-replace 'http://example.com' 'https://example.com' --skip-columns=guid
Run with --dry-run first, and back up the database before the real run.
Fix theme and code references
Change hard-coded http:// URLs in theme files and custom code. For your own domain, a root-relative path (/images/logo.png) avoids the problem entirely.
Third-party resources
If an external service only offers http://, find an HTTPS alternative or host the file yourself.
Belt and braces
Add a header that tells browsers to upgrade any remaining insecure requests:
Header always set Content-Security-Policy "upgrade-insecure-requests"
Treat this as a safety net, not a replacement for fixing the URLs.