Is there any way to prune broken image links?

Amin Sabet

Well-known member
My sites have tons of old, broken image links. Images that were embedded using IMG tags but reference old image URLs that no longer exist on Flickr, etc. Is there any way to prune those without doing them one by one, manually?


Well-known member
A way of doing that would be to run a sql query. You can try something like this.

UPDATE xf_post SET message = REPLACE(message, 'flickers_urls', '');
What this query does, is that it will find all url posted by flickers and then replace them with blank space. It would be the same like deleting them. And of course, replace flickers_urls with the actual urls. And please take a backup before running the query. Because once you will run it, it can not be undone.


Active member

What I've done in my community was replace broken images with a placeholder:

    $("img.bbCodeImage").one('error', function() {
        $(this).attr("src", "/styles/default/placeholder.jpg");
    }).each(function() {
        if (this.complete && !this.naturalHeight && !this.naturalWidth) {
Just add this code before /body