0

It appears that, on uploading, WP media library looks for certain spammy-looking filenames, and prevents these files from displaying. Is this a feature? Is it documented anywhere? Can it be disabled? (Googling turns up nothing.)

Explanation. Using a fresh installation of WordPress 4.8.3 on a new domain, I am publishing a book for an author friend. The book contains about a 100 photos taken during his travels. I was happily uploading the images when I noticed that 1 thumbnail was not showing the photo, but a blank, grey square. This was weird, so I tried placing the image in a post, with the same result: the file exists (and it is the same physical file I uploaded, not altered in any way), but the post shows a blank gray area where the image should be.

The file is named - and I hope StackExchange will permit this, now - "chapter_02_img_02_beer_advertisement_1990.jpg". This is indeed what's in the photo: an ad for beer.

So I am thinking maybe an overzealous admin at my host set up some trap, but no - WP does the same exact thing on localhost, using a different theme, and no plugins whatsoever. And sure enough, when I renamed the file to a more innocuous-looking "chapter_02_img_02_ba_1990.jpg" and reuploaded, the problem went away. (But this is a nuisance, now I have to maintain a separate set of files to keep all links healthy.)

Is this a thing in WordPress, or should I be looking elsewhere for the cause?

1

No, WordPress doesn't do this. You can check by looking at the source code.

What's probably happening is the image is too large for WordPress to resize properly, or it's been corrupted.

Keep in mind that there are breweries with websites powered by WordPress, and you can buy beer themes on markets

1

Solution: It was, of course, the ad blocker in the browser, and I feel quite silly. (So easy to forget about something that works so well.) I'll leave the question here, others may stumble upon the same thing.

(And I'll have to change the filenames anyway, or many people will not be seeing the photos.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.