• I was browsing through my archives and noticed that some images are not showing. It seems very randomly. For instance this page:
    [ redundant link deleted ]
    Some images are showing, some not. Even with posts on the same day.

    If I click on the photo I get a 404 (eg https://basdemeijer.nl/fotos/bdm-20101011-0013-rondvaartboot.JPG). I can see the images via FTP.
    If I look at the media library the image is shown (/rondvaartboot/). But if I click on ‘edit’ I don’t see the image. Also, downloading gives me an HTML file instead of the JPG.

    I am not using a CDN.
    I am using WP Fastest Cache, Really Simple Security and Optimize Database after Deleting Revisions.
    I have cleared all cache
    I did deactivate all plugins
    All without any results.

    It seems it happens on posts posted around October 2010-december 2011. But not all posts are affected. In a post images can show up, while others don’t (eg /afdruk/demonstratie-tegen-politiegeweld/)

    Running WP 7.0, Theme Fox Theme

    Can someone help me out?

    • This topic was modified 1 day, 20 hours ago by basdemeijer. Reason: corrected the theme name

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Moderator threadi

    (@threadi)

    I’m a bit puzzled by the URLs of the photos. These aren’t the kind of files typically used in a WordPress media library. It seems you’ve changed the path to the upload directory, or you’re uploading them via FTP and linking to them manually.

    As for why the URL you mentioned leads to a 404 page, that’s easy to explain: the URL is incorrect because the file extension is misspelled. It says JPG, but it should be jpg. As soon as you spell it correctly, the file will be accessible.

    When using files in URLs, you should pay very close attention to uppercase and lowercase letters. If the files were managed through WordPress (I’m not sure about that), WordPress would handle that for you.

    Thread Starter basdemeijer

    (@basdemeijer)

    Thanks for your replies. It looks like it has to do with the extension. On my FTP it is .jpg, in WordPress it is .JPG. So non-capital versus capital.
    The strange thing is though, I don’t know how that happened. Alle the files were uploaded via the media library in WordPress and at the time of posting, it worked. Else I would have noticed it immediately. Is there a way to change it easily in batch?

    Moderator threadi

    (@threadi)

    How do you insert the images into your page so they appear there? Is this perhaps a feature of your commercial theme “The Fox”? If so, you’ll need to contact their support team for clarification: https://themeforest.net/item/the-fox-contemporary-magazine-theme-for-creators/11103012/support – questions about commercial products cannot be answered here in the forum.

    Thread Starter basdemeijer

    (@basdemeijer)

    I use the classic editor. And it looks like this:
    <a href=”/fotos/filename.jpg”><img class=”align none size-full wp-image-1234″ src=”/fotos/filename.jpg” alt=”text” width=”800″ height=”535″ /></a>

    What I always do is upload the image via the Media Library, and than just hit “enter in post” (or what it is called in English, I am using the Dutch translation).

    I don’t think it has to do with the theme actually. Somehow not all extensions are converted to lower case. And as I said, when I posted the pictures it worked fine. Don’t know when it went wrong, just found it out today per accident.

    Thread Starter basdemeijer

    (@basdemeijer)

    And as said, it seems it only happened with photos around 2010-2011 (didn’t check all my posts)

    Moderator threadi

    (@threadi)

    So, if you create a completely new post and insert any image into it, it works, and the problem only affects posts from 2010/11? If so, it could be a historical issue – they may have been linked incorrectly back then.

    But if it also happens with new posts, I’d recommend ruling out the theme and plugins as the cause. Deactivate plugins (except Classic Editor, probably) and switch the theme as a test.

    Thread Starter basdemeijer

    (@basdemeijer)

    It only occurs in the older posts. New posts have no issues.

    is there a way to correct it in a batch? Via SQL maybe?

    Moderator threadi

    (@threadi)

    If this only affects older posts, there are several ways to automate the process. The problem, however, is that none of these options actually checks whether the links are still accessible. But here are a few options anyway:

    Disadvantage of all options:
    You would have to explicitly limit the replacement to older posts. I’m not sure if that would work reliably.

    And: be sure to create a backup beforehand.

    Alternatively, you can also edit the posts manually. Depending on the number of posts, this might actually be more reliable.

    Another alternative would be a custom WP CLI-driven script that performs the replacement. That would likely be the most precise way to achieve this.

    Thread Starter basdemeijer

    (@basdemeijer)

    Thanks! I have an estimate of over a hundred items to correct. So some automation will be nice. I will dive in your suggestions tomorrow. Thanks for your help!

Viewing 9 replies - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.