Using images in WordPress can be tricky and quirky sometimes, especially in the block editor. Here are some of the image-related bits and bobs I’ve picked up over time.
Media files are publicly visible
If you upload a file to your site, it gets assigned a URL. That’s its home, and whether you include it in a post or not, it can still be found in its home. That means that search engines can see it. I’ve found a few free books that way. People had uploaded them to their website, and may not have visibly linked to it on their site, but Google knew it was there. So don’t upload anything you wouldn’t want the world to see.
Editing image data
When you go to edit an image that you’ve uploaded, this is what you’ve got to work with.
The title matters because this is what will make it easy to search for pictures in your media library.
WP will automatically generate this from the name of the file that you’ve uploaded. In this case, I had a descriptive file name, so the automatic title is useful. If my file name is IMG12345, trying to search for this image using words is going to leave me shit outta luck.
This is how visually impaired readers know what your image is about. It’s also helpful for SEO, as it’s how search engines “see” the image.
You can change your alt text this way, or in the block editor, you can change it in the block settings on the right side of the screen. Sometimes, just for fun, when I enter an alt text in the image edit box, the block editor decides to eat it when it’s supposedly saving it. Bye bye, alt text!
This is the publicly viewable home for the file. When I’m decluttering my media library, I search using this URL in my posts and pages lists to be completely sure I’m not deleting an image that I’m actually using somewhere.
This shows the dimensions of the image in pixels. Large images slow down the loading of your page. I use the Smush plugin, and Renard of Renard’s World has recommended TinyPNG as a more accessible option that anyone can use.
Google Images searchability
Besides indexing the text of your images, Google’s web crawlers also index your images. I don’t know the nuts and bolts of this, but I do know that photos and Canva graphics I upload appear in Google Images search results.
So, if you upload your own pictures to your blog, and you haven’t made your site unsearchable, those images can show up in Google Images searches. This matters if you want to protect your copyright on those images, because not everyone realizes that Google Images is a search engine rather than a source of freely useable images. If this is something you want to avoid, you could try watermarking your images, or simply avoid putting in search-friendly alt text or file names.
Insert from URL
In the block editor, you can insert images from URL… sometimes. You can’t do it from Unsplash. From Pixabay, once you find your image, click “free download,” and then “view.” A new window will pop up with the image, and you can use that URL to upload to WP.
Replacing an Image
In the block editor, if you’ve placed an image into a post, you can replace the image without having to delete the existing block and create a new one. But let’s say you had changed the size of the original image to make it smaller. You replace it, and the replacement image looks small too. Except it might not be. When you publish or update the post, the image might be full size. I think WP has fixed this, but I’m not entirely sure.
If you happened to insert one of your images contained a post using a URL, and then you replace an entirely different image in the same post, WP will replace your URL-sourced image too, just for fun. You might not realize until you return the post later and wonder what the hell? Thanks, WordPress block editor.
Is it really centred?
When you make an image smaller, it shows up as centred in the block editor. It’s not. Unless you’ve actually clicked the button to centre it, it’s just pretending to be centred.
My feeling in general with the block editor is that it makes harder things easier and/or possible, which I certainly appreciate, but it makes things that should be easy harder. They really need to hire some more people to do testing, because there’s no reason for there to be so many bugs in something that’s been around for a while now.
But despite all of that, WordPress is a pretty amazing place to be.
Are there any oddities you’ve coming across with respect to using images in WordPress?