Find/Replace Broken Links

Hi, I use Ghost(Pro). I’m aware that if I download JSON I might be able to find/replace content. But that’s beyond my skill set TBH.

It Would be great if there was a find/replace admin feature for fixing broken links. I don’t expect Ghost to alert me to broken links, but it would be great if I could make updates quicker than going post by post or having to hire someone.

Currently learned of 200 broken links and it’s painful TBH.

Thanks for your consideration.

Editing JSON could work, but keep in mind that replacing the content after a JSON edit will essentially create a new copy of a post, so Ghost post analytics would be gone. Also, don’t forget you need to delete all content and THEN import the updated JSON as the importer is additive.

Redirects are a good way to manage broken internal links: Redirects

A custom error page that invites the user to contact you if they hit a dead end is always cute and can surface dead links that matter.

1 Like

@jmac If you are technically inclined or know someone who is, another option might be to use the Admin API.

When I migrated a long-running site from Ghost LTS to Ghost ~5, I used a somewhat modified version of the all posts search and replace example script to re-write every instance of “a markown image inside a block level HTML element” to an HTML image.

It would probably be possible to extract all URLs, check them[1], and output a list of dead ones. What to do with the dead ones is another question. Programmatically link to snapshots when available, perhaps?

1 Like