EN | ES

Lesson 24: Image Optimization and Performance Plugins

Objectives


Why Image Optimization Matters

Images are typically the largest files on any web page:


Image Optimization Strategies

1. Resize Before Uploading

2. Choose the Right Format

Format Best For File Size
JPEG Photos, complex images Small-medium
PNG Graphics with transparency, screenshots Larger
WebP Everything (modern replacement for JPEG/PNG) Smallest
SVG Logos, icons, illustrations Tiny (vector)
AVIF Next-gen format (limited support) Very small

WebP is the best general-purpose format — 25-35% smaller than JPEG with similar quality.

3. Compress Images

4. Lazy Loading


Image Optimization Plugin — Smush

Installation

  1. Plugins → Add New → search "Smush"
  2. Install and activate "Smush — Lazy Load Images, Optimize & Compress Images"

Configuration

  1. Go to Smush → Dashboard (or follow the setup wizard)

  2. Bulk Smush:

    • Click "Bulk Smush Now" to optimize all existing images
    • Free version compresses up to 50 images at a time
    • Repeat until all images are done
  3. Settings to configure:

Automatic Optimization:

Lazy Loading:

Resize Original Images:

Alternative Plugin: ShortPixel

ShortPixel is another excellent option:

Alternative Plugin: Imagify

By the WP Rocket team:


Other Performance Plugins

WP Super Cache (Already Installed)

We set this up in Lesson 22. It caches pages for faster delivery.

Additional Performance Tips

Minification: Some plugins can minify your CSS and JavaScript (remove whitespace and comments to reduce file sizes):

CDN (Content Delivery Network): A CDN stores copies of your site's files on servers worldwide, serving content from the server closest to the visitor:


Testing Performance

Tools

Google PageSpeed Insights (for live sites):

GTmetrix (for live sites):

Chrome DevTools (works locally):

  1. Open your site in Chrome
  2. Press F12Network tab
  3. Refresh the page
  4. See every file loaded, its size, and load time
  5. Look at the bottom bar for total page size and load time

Lighthouse (built into Chrome):

  1. Press F12Lighthouse tab
  2. Click "Analyze page load"
  3. Get scores for Performance, Accessibility, Best Practices, SEO

Performance Checklist

Images:

Plugins:

General:


Exercises

  1. Install Smush: Install, activate, and run a bulk optimization on all existing images.

  2. Enable lazy loading: Configure Smush to lazy load images.

  3. Enable auto-optimization: Turn on automatic optimization for future uploads.

  4. Test with DevTools: Open your homepage in Chrome, press F12, go to the Network tab, and note the total page size. Screenshot or write down the number.

  5. Run Lighthouse: Use Chrome's Lighthouse tab to test your local site. Note your Performance, Accessibility, and SEO scores.

  6. Optimize a large image: Find a large photo online (3000px+), upload it to WordPress without optimization, note the size. Then delete it, resize and compress it first, and upload again. Compare the sizes.


Key Takeaways


Next Module: Module 5 - WooCommerce Basics