Fix mixed-content links after an HTTPS switch

MaintenanceIntermediate~20 minUpdated

Before you start

A connected site with content reads on and Replace block enabled, plus Update post for any content that is not in blocks. An http URL sits in an href or src attribute, and the find-and-replace tool refuses anything inside a tag or attribute, so the agent reads each post as raw block markup and rewrites the block that holds the URL. This reaches the body of posts and pages only, so http references in theme options, widgets, menus, or the database need a different tool. Pages are reached only while the Update page tool is on. Posts owned by a page builder are refused. Take a backup before a large pass. The Changes tab records each edit and can revert it, but not once the post has been edited again.

You moved the site to HTTPS, the padlock shows up, and you think you are done. Then a browser flags a page as not fully secure because an old image or link is still hardcoded to http, and the mixed-content warning drags the whole page down. The references are scattered through years of posts, and finding them by hand means opening everything.

This prompt finds the leftover http links in your content and rewrites the ones you approve, one block at a time. It is deliberate about scope, and it separates your own domain from external sites so you do not break a resource that genuinely only serves over http.

The prompt
I switched this site to HTTPS and I think some old http links are still in the
content. Work in two passes and change nothing in the first.
First pass: search my posts and pages for http links and group the results by
where they point, my own domain in one group and external sites in another, so
I do not accidentally break a resource that is only served over http. Show me
the exact strings you would rewrite, the http version beside the https one.
I will approve which to change. Only then, go one post at a time in small
batches. A URL in an href or src sits inside a tag, so a plain
find-and-replace will be refused. Instead read the post as raw block markup
and replace only the block that holds the URL, sending exactly one block and
passing its path and its block name as the expected block name. Keep the rest
of the block as it was. Show me each batch with the old block markup beside
the new one before it saves. If a post has classic content with no blocks, or
a block that will not save back cleanly, tell me and wait for my go before
using the full post update, and paste the post's current body into your reply
first. Do not touch post status. List every post you edited and every one you
skipped.

Why this is safe to run

The first pass is a read. Searching your content surfaces every http reference without changing anything, and grouping your own domain apart from external sites is the point: rewriting a link to your own site to https is safe, but forcing https on an external resource that only serves over http would break it, so you approve the exact strings before any swap.

The rewrite is honest about its reach, and this is the caveat that matters. It edits the body of posts and pages only. Insecure references living in theme options, widgets, menus, or elsewhere in the database are outside its scope and need a different fix, so treat this as the content half of the job, not the whole thing. Within that scope it is reversible: Replace block swaps one block and checks the block name at that path before it writes. The prompt asks for the old markup with each batch, so a wrong replacement can be put back; the Changes tab can also revert it for up to 30 days, if nothing else has changed on the post. The write abilities stay off until you enable them, and every edit is logged.

Already connected? Skip the paste. Ask your agent for the “fix mixed-content links after an HTTPS switch” recipe, or just say your old http links need cleaning up, and it runs the same two-pass flow on your own content.

How it works

  1. Search your posts and pages for http links left over from the old URL scheme.
  2. Group them by where they point, separating your own domain from external sites.
  3. Show you the exact before-and-after strings and wait for your approval.
  4. Read each affected post as raw block markup and rewrite only the block that holds an approved link, one post at a time, in small batches.
  5. Return every post it changed so you can spot-check the result.

Questions

Does it fix mixed content everywhere?
No. It edits the body of posts and pages only. Insecure references in theme settings, widgets, menus, or the database are outside its reach and need a different fix.
Can I undo a bad replacement?
Yes. Each fix swaps one block, and the agent shows you the old block markup with every batch, so a wrong swap can be put back. The Changes tab in wp-admin can revert the same swap if the post hasn't been edited since.