Skip to main content

WordPress Image SEO: Compress, WebP and Alt Text

  • October 16, 2026
  • 8 min read
  • By CYPHEX
WordPress Image SEO: Compress, WebP and Alt Text

On most WordPress sites, images are the heaviest part of every page, so they decide how fast the page feels and how well it can be understood by search engines and screen readers. This guide gives you a routine for WordPress image SEO that you can apply to every upload: size, compression, format, file name, alt text, loading behaviour and discovery. It is written for site owners and the editors who upload pictures, with notes for whoever manages the hosting.

Why images matter for speed and SEO

An oversized photo hurts in two ways. It slows the page, and if it is the main picture above the fold it becomes your Largest Contentful Paint, one of Google’s Core Web Vitals (target: 2.5 seconds or less, per web.dev). It also takes up bandwidth for people on mobile data. Our Core Web Vitals guide for business owners explains how to read the numbers.

For search, images help in two ways. They can appear in Google Images, and they give context to the page they sit on. Google’s image SEO documentation says to place images near relevant text, use descriptive file names and alt text, and optimise them because images are often the largest part of page weight.

Be realistic: image search brings some traffic to some sites (shops, recipes, travel, portfolios), and very little to others. For most service businesses the main prize is speed and accessibility, with image search as a bonus.

Step 1: Resize before you upload

The biggest saving comes from sending the right number of pixels. A phone photo is often 4000 pixels wide, yet your content column may display it at 800. WordPress creates smaller copies and serves them with srcset, but the original still sits on your server, and a huge original still gets used in places.

Practical rule: look at the widest space the image will fill on your site, then export at about that width, or up to double for sharp screens. Full-width banners might need 1600 to 2000 pixels; a blog photo often needs 1000 or less. Check your theme’s layout rather than trusting a rule of thumb.

Step 2: Choose a format

Google lists BMP, GIF, JPEG, PNG, WebP, SVG and AVIF as supported, and says to keep file extensions matching the real file type. In practice:

Image typeGood format
PhotosWebP or JPEG
Screenshots, graphics with textWebP or PNG
Logos and iconsSVG (with care) or PNG
AnimationsVideo or animated WebP, not large GIFs

Is WebP worth using?

Google’s WebP page says lossless WebP files are 26% smaller than PNG, and lossy WebP files are 25 to 34% smaller than comparable JPEG at the same quality measure. Those are Google’s figures for its test sets, so your savings will vary by image.

WordPress has supported WebP uploads since version 5.8. The core announcement lists the catches: your host must be able to process WebP, otherwise the upload fails with an error; lossless WebP needs the Imagick library; and transparent or animated WebP files are not supported for resized copies. Ask your host, or upload a test file and see what happens.

Google’s documentation lists WebP as a supported format, and nothing there promises a ranking lift for using it. The benefit is a smaller file and faster pages. Do not spend hours converting a library when resizing would do the job.

Step 3: Compress

Compression reduces file size by discarding detail the eye barely notices. Aim for the smallest file that still looks good at the size it appears.

  • Export at a sensible quality setting (for photos, a moderate setting usually looks identical to a high one at a much smaller size). Judge by eye on a real screen.
  • Use a tool you trust: an image editor, a desktop optimiser, a web tool such as Squoosh, or a WordPress plugin that compresses on upload.
  • Keep the original somewhere safe. Compress copies, not your only master.

Do not inline big images as data URIs inside HTML or CSS. Google warns this can increase page size significantly.

Step 4: Name the file properly

A descriptive file name tells people and search engines what is in the picture. Google’s example is my-new-black-kitten.jpg rather than IMG00023.JPG. Use lowercase words separated by hyphens, short but specific. boiler-service-leeds.webp is useful; final-v3-REAL.webp is not. Rename before uploading, because renaming after publishing breaks links and requires changes in every post that uses the image.

Step 5: Write alt text that helps

Alt text is the text alternative for an image. It is read aloud by screen readers, shown if the image fails to load, and used by Google as context. Google says to describe the image in context and not to stuff keywords.

The W3C’s alt decision tree is a clear way to decide:

  1. Informative image (adds meaning): write a short description that conveys that meaning.
  2. Image of text: repeat the text, unless the same text is on the page.
  3. Image in a link or button: describe where it goes or what it does, not what it looks like.
  4. Complex image like a chart: give a short alt and put the full information elsewhere on the page.
  5. Decorative image or one that only repeats nearby text: use an empty alt="" so screen readers skip it.

Compare:

ImageWeak alt textBetter alt text
Photo of a fitted kitchenkitchenShaker-style kitchen with white cabinets and oak worktops
Logo linking to the home pagelogoExample Co home page
Background swirlswirl pattern best cheap kitchens“ (empty)

Do not start with “image of”. Keep it as long as the meaning needs, which is usually a short sentence. Do not paste your target keyword in every alt tag; if the picture genuinely shows it, say it once and move on.

In WordPress, fill in Alt Text in the Media Library or the block sidebar. Changing alt text in the Media Library does not always update copies already placed inside older posts, so check important pages.

Step 6: Load images the right way

WordPress adds srcset and lazy loading by default for images it knows about. A few things to check:

  • Never lazy-load the main image at the top of the page. web.dev says adding loading="lazy" to the LCP image delays its request. Lazy-load pictures below the fold.
  • Prioritise one hero image. fetchpriority="high" on the likely LCP image helps; use it on only one or two images, or it loses its effect.
  • Always set width and height. web.dev advises including width and height attributes (or CSS aspect-ratio) so the browser reserves space and the layout does not jump. WordPress normally outputs them, but custom code and page builders sometimes remove them.
  • Use real <img> elements. Google says it cannot index CSS background images, so a picture you want found should be an <img> with a src.

Your theme or page builder controls much of this. If you are unsure, ask a developer to check the hero image on your key pages.

Step 7: Help Google find the images

An image sitemap, or image entries in your normal sitemap, helps Google discover pictures it might miss, such as ones loaded by JavaScript. Google allows image URLs hosted on other domains, like a CDN. Many SEO plugins add this for you; check which one you use rather than installing a second. Also include the image property in structured data where a feature needs it, and set a good preview image with og:image, as Google suggests choosing relevant, high-resolution images that are not extreme in shape. See our image and media SEO guide for the technical side.

A routine for every upload

  • Resize to the display width
  • Compress and, if your host supports it, export as WebP
  • Rename with a descriptive, hyphenated file name
  • Add alt text (or empty alt for decoration)
  • Set width and height; do not lazy-load the hero image
  • Place it next to relevant text
  • Recheck page speed in PageSpeed Insights

Doing this by hand on a large library is slow. Our free plugin, CYPHEX Image Hunter, is built around this routine inside WordPress: it searches free stock libraries, converts uploads to WebP, compresses them and writes titles, alt text and captions with AI. Originals are kept, renames are previewed and you can roll back. Other plugins also compress images, so choose the one that fits how you work, and review any AI-written alt text before publishing.

Frequently Asked Questions

Does WordPress support WebP?

Yes, since version 5.8, as long as your host’s image library can process it. Upload a test file to find out.

How long should alt text be?

As long as it needs to be to convey the meaning, usually one short sentence. The Google page we reviewed sets no fixed length, so write for people first.

Should I use WebP or JPEG?

WebP is usually smaller at similar quality, per Google’s figures. JPEG is fine if your host or workflow struggles with WebP. Resizing matters more than the format.

Do image titles and captions help SEO?

Google’s image documentation focuses on file names, alt text, page context and fast loading. Captions can help readers. Do not expect rankings from the title field.

Why is my hero image slow even after compression?

Common causes: it is being lazy-loaded, it loads late via script or CSS, or the server responds slowly. Use PageSpeed Insights to see the LCP element and its timing.

Conclusion

WordPress image SEO is mostly routine: resize, compress, name, describe, load sensibly and make images discoverable. Put the effort where the pages matter most, starting with the hero image on your top five pages. Do not chase tricks; fast, accessible, relevant images are what Google’s own documentation asks for. If you would like help with this, CYPHEX can plan and deliver it for you, with one project lead as your contact. You can also read about our WordPress and WooCommerce services.

For the basics of writing and adding alt text in WordPress, see WordPress alt text: how to write and add it.

Stock photography provided by Pexels under the Pexels License.

Need a feature your site does not have?

We build small, clean plugins and connect your tools so you do not repeat work by hand.

Comments

  1. Loading comments...

Leave a comment

Free quote

Get a clear plan and fixed price

Tell us what you need in three quick steps. No obligation, no jargon, and no pressure.

Step 1 of 3

Tell us what you need

Three quick steps. We reply within one business day.

What do you need help with? Pick all that apply