Skip to content
GPLWP Guides

How to optimize images for SEO in WordPress

SEO Time About 20 minutes for a new image, or several hours for a large library 6 steps Updated 3 Dec 2026

SEO
The short answer

Optimise images before uploading, then use descriptive filenames, accurate alt text, suitable dimensions and compression in WordPress. Manual optimisation is fine for a small library; use a plugin when you need to update image metadata or filenames in bulk.

The route
  1. 01Choose the right image file
  2. 02Rename the file before uploading
  3. 03Add useful image metadata
  4. 04Insert the appropriate image size
  5. 05Check the page around the image
  6. 06Use bulk automation when needed

What you need

  • A WordPress site with administrator access
  • The original image files
  • A way to resize or compress images before upload

Choose the right image file

Start with the image you actually need. Resize it close to the largest display size on the page instead of uploading a camera original several thousand pixels wide. WordPress creates intermediate sizes, but it does not make an oversized source image ideal for every layout.

Use a suitable format: JPEG or WebP for most photographs, PNG for graphics that need transparency, and SVG only where your WordPress setup safely supports it. Keep the image sharp while reducing unnecessary file size. Images can account for much of a page's downloaded data, so both quality and size matter.

Rename the file before uploading

Give the file a short, descriptive name such as blue-wool-cushion.jpg, not IMG_4832.jpg. Use words that describe what the image shows and separate words with hyphens. Do not stuff the filename with repeated keywords.

Rename the file on your computer before upload. WordPress lets you change the media title and attachment-page slug, but changing the title does not rename the actual uploaded file or its file URL. Renaming an existing file can therefore require replacing references and checking for broken images.

Add useful image metadata

Go to Media > Library, open the image and complete the Alt Text field. Describe the image's meaning in its page context, rather than listing every visible detail or adding keywords for their own sake. For a decorative image, leave the alt text empty.

Add a caption only when visitors need that information, and use the description field for useful media-library or attachment-page information. WordPress uses the media-library alt text as the default when you insert the image, but you can change alt text for a specific page without changing the library value.

Insert the appropriate image size

When you insert the image, choose the smallest WordPress size that remains sharp at its displayed width. Do not use Full Size simply because it is the default choice if the image will appear much smaller.

WordPress normally creates intermediate image sizes and can provide responsive image markup so browsers select a suitable file for the available screen. Check the page on a phone and desktop after publishing, because a theme, page builder or custom image code can bypass the normal responsive behaviour.

Check the page around the image

Make sure the image sits beside relevant text and supports the page's subject. Google uses the alt text, page content and computer-vision systems together to understand an image, so metadata cannot compensate for an irrelevant image or an unclear page.

Open the published page, confirm the image loads, inspect it at mobile width and run the URL through PageSpeed Insights. If a page becomes slow after adding an image, reduce its dimensions or compression level before changing its alt text.

Use bulk automation when needed

For a small site, the manual route is usually enough: prepare each file, edit its alt text in the Media Library and choose the right display size. It costs nothing extra and gives you better context than blindly generating text. The drawback is that WordPress does not provide a native bulk workflow for rewriting every image filename and metadata field, and renaming old files can break references.

For a large or neglected media library, AIOSEO can automate image titles, alt tags, captions, descriptions and filename cleanup in bulk. It is an official add-on for All in One SEO Pro, which must be installed and active. Review generated metadata before publishing, because an automated description can be technically valid but wrong for the image's actual purpose.

The fast route

Let AIOSEO do it

Automatically fills image metadata and cleans filenames; ideal when you want image SEO handled in bulk inside WordPress.

Get AIOSEO

Sources

  1. developers.google.com /speed/docs/insights/OptimizeImages?hl=en&utm_source=openai
  2. developers.google.com /search/docs/appearance/google-images?rd=1&visit_id=63750551…
  3. wordpress.org /documentation/article/image-block/?utm_source=openai
  4. developer.wordpress.org /reference/functions/wp_generate_attachment_metadata/?utm_so…
  5. wordpress.org /support/topic/change-image-filename/?utm_source=openai

Questions

Does WordPress optimise images for SEO automatically?
WordPress automatically creates several intermediate image sizes and can output responsive image markup, but it does not decide whether a filename or alt text accurately describes the image. You still need to prepare the source file, write useful alt text and choose an appropriate display size. A theme or page builder can also bypass normal responsive behaviour, so check the published page rather than assuming the defaults are being used.
Should every image have alt text?
Every informative image should have concise alt text, but decorative images should use empty alt text. Describe the image's purpose in the surrounding page, not just its visual appearance, and do not repeat nearby text unnecessarily. Alt text supports screen-reader users and also helps Google understand the image, but keyword stuffing makes the description less useful.
Can I change an image filename after uploading it?
Changing the media title in WordPress does not normally change the actual uploaded filename or file URL. The safer manual approach is to rename the file before uploading a replacement, then update every place where the old image was used and check for stale URLs. A filename-management plugin can handle this more safely on a large site, but take a backup first.
What image dimensions should I use for SEO?
Use dimensions close to the largest size at which the image will appear on your site, while keeping enough resolution for high-density screens. There is no single SEO width that fits every theme: a full-width banner, product image and thumbnail need different sizes. Uploading a much larger image than the layout needs increases download size, while an undersized image looks blurry.
Do I need a plugin to optimise image SEO in WordPress?
You do not need a plugin for a small library if you can rename files before upload, compress them, add alt text and select suitable image sizes manually. A plugin becomes useful when you need bulk metadata, automated filename cleanup or help auditing many existing attachments. Automation still needs review: image context varies, and a generated alt text can be inaccurate or misleading.