Why do I get a 404 error when I click on images in my posts?
-
I have uploaded some images to my library and then inserted them into various posts. However, when I click on an image after publishing my post – I get a 404 error. Why might this happen? How can I fix it?
The blog I need help with is: (visible only to logged in users)
-
Hi,
The most common reason for that error would be that an image was deleted from the library after inserting it in a post, page, etc. You have to leave it in the library.
-
Hi, Thanks for responding. However, the images are still in my media library and available to edit. And I’m nowhere near my space limit. It has occurred in todays post even. It is however, inconsistent as not all images are unavailable – and I use the same method each time.
-
If you have not edited the corresponding image permalinks, then I can’t imagine what might be causing the errors. I’ll add a “modlook” tag to the sidebar of this topic to call for staff attention.
-
-
Hi @davehorlick, interesting issue! Can you tell me how you’re going about inserting the images and their links?
Let me know which editor you’re using, for example:
– wp-admin
– a desktop app
– a mobile app
– post by email
And, when you insert the image and insert the link, what options are you clicking on?
Here’s an example based on what I just did:
– went to https://wordpress.com/post
– clicked the + to add new media
– uploaded a picture
– inserted it
– clicked on the image
– clicked the link icon
and it added the right link automatically. If you can let me know what steps you’re using, I’ll try to duplicate them.
-
@ davehorlick,
@ supernovia,I’ve found a pattern which suggests that in recent posts the image permalinks have sometimes been altered, with the removal of the publish month.
- The image on the post “Tuesday 30th August” with the address
https://waltoncommon.wordpress.com/h1/ is shown on the attachment page
https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/h1/
and the media file address is
https://waltoncommon.files.wordpress.com/2016/09/h1.jpg
Similarly, the image in the same post with the address
- https://waltoncommon.wordpress.com/2014-09-04/
is present on the attachment page
https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/2014-09-04/, and the media file address is
https://waltoncommon.files.wordpress.com/2016/08/2014-09-04.jpg.
The images which are working properly don’t show the same pattern. They aren’t missing the publish month. For example, the image in the same post with the address
- https://waltoncommon.files.wordpress.com/2016/08/img_4776.jpg, is found on the attachment page https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/img_4776/, and the media file address is https://waltoncommon.files.wordpress.com/2016/08/img_4776.jpg.
- The image on the post “Tuesday 30th August” with the address
-
Unfortunately, making the months bold in the URL disrupted the links here, so I’ll give that again without the bold.
There is a pattern on recent post of the site https://waltoncommon.wordpress.com/ which suggests that image permalinks have sometimes been altered, with the removal of the publish month.
- The image on the post “Tuesday 30th August” with the address
https://waltoncommon.wordpress.com/h1/ is shown on the attachment page
https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/h1/
and the media file address is
https://waltoncommon.files.wordpress.com/2016/09/h1.jpg
Similarly, the image in the same post with the address
- https://waltoncommon.wordpress.com/2014-09-04/
is present on the attachment page
https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/2014-09-04/, and the media file address is
https://waltoncommon.files.wordpress.com/2016/08/2014-09-04.jpg.
The images which are working properly don’t show the same pattern. They aren’t missing the publish month. For example, the image in the same post with the address
- https://waltoncommon.files.wordpress.com/2016/08/img_4776.jpg, is found on the attachment page https://waltoncommon.wordpress.com/2016/08/31/tuesday-30th-august/img_4776/, and the media file address is https://waltoncommon.files.wordpress.com/2016/08/img_4776.jpg.
- The image on the post “Tuesday 30th August” with the address
-
-
Another correction:
What I referred to as the “publish month” is actually the month the image file was created. -
The process I have been using is:
WP Admin/Media/Add new. When the image has uploaded I amend the caption etc.
When I have written my blog I insert the image into the post.
I seem to have two ways of adding a post and I’m not sure what the difference is. One has a black sidebar and the other a blue one. Both appear to achieve the same end – but is this where things go awry? -
When the image has uploaded I amend the caption etc.
Regardless of which editor you use to edit images inserted a post or page, you can edit anything you like (caption, alternative text, alignment, dimensions, link to setting, etc.) as long as you don’t change the permalink. Changing the permalink gives the image a different URL than the one corresponding to it in the media library. When we click on such an image, it isn’t recognized because the new URL doesn’t correspond to an image in the media library.
-
So it looks like at some stage you edited the image file creation date and month out of
https://waltoncommon.files.wordpress.com/2016/09/h1.jpg
to get https://waltoncommon.files.wordpress.com/h1.jpg, and did the same to https://waltoncommon.files.wordpress.com/2016/08/2014-09-04.jpg to get https://waltoncommon.files.wordpress.com/2014-09-04.jpg. I believe this step, editing the permalinks, is causing the 404 errors. -
Doc is right. You are losing the dates. Can you clarify this part?
When I have written my blog I insert the image into the post.
I believe that’s where the dates in your link are getting lost.
And yes, to clarify you do have an older wp-admin interface as well as wordpress.com/post (which is more like our desktop and mobile apps.)
You are welcome to choose whichever you’d like, though our interface will encourage you to use https://wordpress.com post.
-
Hi supernovia!
By “creation date and month” I meant “year and month.” I’ve made too many mistakes lately. Time to take a break perhaps.
-
Hi apologies for the delay … it’s been a busy weekend.
When I have drafted a blog I insert images using the ‘add media’ button. I usually upload the images in advance and then amend the file name to something more meaningful e.g a plant name or suchlike. I don’t do any other adjustments i.e. I don’t play with the permalink and I don’t adjust the image (all done in Lightroom). I can see the permalink has changed – but it isn’t something I have ‘played with’.
I am continuing to use a bookmark from a long time ago – so the starting place for a new post is usually (probably) the older wp-admin interface – if that is relevant. -
Hi again, my apologies right back for being slow to reply.
Can you clarify what steps you’re using here?
I usually upload the images in advance and then amend the file name to something more meaningful e.g a plant name or suchlike.
And about this:
I am continuing to use a bookmark from a long time ago – so the starting place for a new post is usually (probably) the older wp-admin interface – if that is relevant.
Can you send this link?
-
And @musicdoc1 , no worries; you’re doing great. I do hope you’re giving yourself good breaks though, too :)
-
Hi,
A couple of links – first one is the one I use for uploading images and the second for drafting a new post.https://waltoncommon.wordpress.com/wp-admin/media-new.php
https://waltoncommon.wordpress.com/wp-admin/post-new.php
Best Regards
Dave
-
This is the part I’m wondering about:
and then amend the file name to something more meaningful
How are you going about doing that?
- The topic ‘Why do I get a 404 error when I click on images in my posts?’ is closed to new replies.