Performance8 min readPublished: 22 Apr 2025Updated: 9 Nov 2026

Offloading WordPress Media to External Storage

When moving WordPress media to object storage helps, when it hurts, how to move it without breaking image URLs, and how to keep a UK site's images fast.

G7Cloud Engineering
Platform team
Share:
Abstract illustration representing offloading wordpress media to external storage.
  • Offloading fixes a storage problem, not a speed problem. A CDN in front of your existing files is usually the faster fix.
  • It is worth doing when the media library is very large, when several servers must share it, or when storage cost is the limit.
  • Keep the local copy until everything is verified. Deleting it is the one step you cannot undo.
  • Store files near your visitors. A UK audience served from a US bucket waits longer for every image.

Should I offload WordPress media at all?

Only if storage is the problem. Offloading means moving your media library (the images and files in wp-content/uploads) to a separate storage service such as Amazon S3. It saves disk space, shrinks backups and lets several servers share one library. It does not make images faster on its own, and done carelessly it makes them slower.

ProblemOffloading helps?Better answer
Images load slowlyNoA CDN, plus compression and correct sizing
Running out of disk spaceYesOffloading, or a larger disk
Backups take hoursYesOffloading, or leaving media out of the nightly job
Several servers need the same mediaYesOffloading, or shared storage
Storage costs are highYesObject storage costs far less per gigabyte
Poor Core Web VitalsNoImage format, dimensions and lazy loading

Slow images and poor Core Web Vitals are the two most common reasons people offload. Offloading fixes neither.

Try a CDN in front of local files first

A CDN (content delivery network) keeps copies of your files on servers close to your visitors. You get the speed with none of the migration risk: files stay put, URLs do not change, and there is nothing to undo.

How big is the problem?
cd /var/www/example.com

# Total media size
du -sh wp-content/uploads

# By year, so you can see the growth
du -sh wp-content/uploads/*

# How many files?
find wp-content/uploads -type f | wc -l

# The largest individual files
find wp-content/uploads -type f -size +2M -exec ls -lh {} \; \
  | awk '{print $5, $9}' | sort -rh | head -20

# Disk headroom
df -h .
Under about 20 GB, offloading rarely pays for its complexity. Above 100 GB it usually does.

How do I choose a storage provider for WordPress media?

Two things decide it: where your visitors are, and what the provider charges to read files back out. Those charges are called egress fees. People rarely budget for them, and on an image-heavy site they can cost more than the storage itself.

CheckWhy it matters
RegionA UK audience served from a US region waits for the round trip on every image
Egress feesSome providers charge per gigabyte served; some charge nothing
S3 compatibilityNearly every WordPress offload plugin speaks the S3 API. Anything else narrows your choice of plugin
A CDN in frontEssential. Serving straight from a bucket is slower than serving from your own server
Data residencyYour contracts or policies may require UK or EU storage

Check egress first. Cheap storage with high egress can cost more than a plain disk.

A bucket without a CDN is a step backwards

Object storage is built to keep files safe, not to deliver them quickly to browsers. Images served straight from a bucket usually arrive later than images from your own web server. Put a CDN in front, and check it is caching rather than passing every request through.

How do I migrate media without breaking image URLs?

Order matters. Copy, check, switch the URLs, check again, and only then think about removing local files.

  1. 1Back up the database and the uploads folder. The plugin rewrites URLs across the database, so keep the state from before the change.
  2. 2Copy the files up and leave the originals in place. Use rclone or the provider's own tool. Nothing on the site changes yet.
  3. 3Check the copy by comparing file counts and total size on both sides.
  4. 4Install and set up the offload plugin with URL rewriting switched off. Confirm it can list and write to the bucket.
  5. 5Switch on URL rewriting, then check pages, the media library, and any theme or plugin that builds image URLs itself.
  6. 6Leave the local files alone for at least two weeks. They are your way back. Deleting them is the only step you cannot reverse.
Copy and verify with rclone
# Configure the remote once, interactively
rclone config

# Dry run first: shows what would transfer, changes nothing
rclone sync --dry-run wp-content/uploads/ myremote:my-bucket/uploads/

# The real copy, with progress
rclone sync --progress --transfers=8 \
  wp-content/uploads/ myremote:my-bucket/uploads/

# Verify: counts and sizes must match
find wp-content/uploads -type f | wc -l
rclone size myremote:my-bucket/uploads/
du -sb wp-content/uploads

# Byte-level check on a sample
rclone check wp-content/uploads/ myremote:my-bucket/uploads/ --one-way
rclone check compares checksums, not just sizes. Run it before you trust the copy.

Never let the plugin delete local files on the first pass

Most offload plugins offer to remove the local copy after upload. Leave that off for at least two weeks, until everything is verified. If the URL rewriting is wrong, or the plugin stops being maintained, the local files are your only way back short of a restore.

Check the URLs actually changed
# How many attachment URLs still point locally?
wp db query "SELECT COUNT(*) FROM wp_posts
  WHERE post_type='attachment' AND guid LIKE '%example.com/wp-content/uploads%'"

# Image URLs hardcoded inside post content: these are the ones
# plugins often miss
wp db query "SELECT ID, post_title FROM wp_posts
  WHERE post_content LIKE '%/wp-content/uploads/%' LIMIT 20"

# Any broken images on the homepage?
curl -s https://example.com/ \
  | grep -oE 'src="[^\"]*\.(jpg|png|webp|avif)"' \
  | cut -d'\"' -f2 | sort -u | while read -r u; do
      code=$(curl -s -o /dev/null -w '%{http_code}' "$u")
      [ "$code" = 200 ] || echo "$code $u"
    done
The last loop prints only failures. No output means every image on the page loads.

What goes wrong when offloading WordPress media?

ProblemCauseFix
Images broken after switchingURLs inside post content were not rewrittenSearch and replace across post_content as well as guid
Media library shows blank thumbnailsBucket permissions block public readsAllow public read on the objects, or serve through the CDN
New uploads stay localPlugin not set up for new mediaSwitch on upload-on-add in the plugin settings
Images slower than beforeNo CDN, or a distant regionPut a CDN in front and choose a nearer region
Large egress billEvery image request is billed at the bucketCheck the CDN is caching and not passing requests through
Cannot regenerate thumbnailsWordPress cannot read the originals locallyRegenerate before offloading, or keep local copies

Broken images and missing originals are why the local copies stay until you are certain.

Fixing URLs left behind in content
# ALWAYS dry run first
wp search-replace 'https://example.com/wp-content/uploads' \
  'https://cdn.example.com/uploads' \
  --dry-run --report-changed-only

# Then for real, skipping the tables that must not be touched
wp search-replace 'https://example.com/wp-content/uploads' \
  'https://cdn.example.com/uploads' \
  --skip-columns=guid \
  --skip-tables=wp_users,wp_usermeta

# Serialised data is handled correctly by wp search-replace.
# A raw SQL UPDATE will corrupt it. Never use SQL for this.

Never replace URLs with raw SQL

WordPress stores many settings as serialised PHP, which records the length of every piece of text. An SQL UPDATE changes the text but not the lengths, so the data becomes unreadable. It usually shows up as plugin settings quietly resetting to defaults. wp search-replace understands the format and fixes the lengths.

What makes WordPress images load faster?

If speed was the goal, these changes deliver it, biggest first. None of them moves a file.

  1. 1Serve the right dimensions. A 4000 pixel original shrunk by the browser still downloads in full. On most sites this is the largest single win.
  2. 2Use WebP or AVIF. These formats are typically 25 to 50 percent smaller than JPEG at the same quality, and every current browser supports them.
  3. 3Lazy load images below the fold, never the main hero image. Delaying the largest visible image delays your Largest Contentful Paint, the loading score Google measures.
  4. 4Set width and height on every image, so the browser reserves the space and the page does not jump as images arrive. That fixes Cumulative Layout Shift.
  5. 5Put a CDN in front, wherever the files live, so a visitor in Glasgow is not fetching every image from one distant server.
  6. 6Set long cache headers. Images rarely change. A one-year max-age on versioned file names is safe and stops repeat downloads.

These six changes usually matter more than where the files live. Core Web Vitals for WordPress shows which score each one improves, and why WordPress performance should not depend on plugins covers the server underneath.

Check whether storage is really your limit

Running out of space is the usual reason to offload. On G7Cloud each site has its own storage allowance, you can see how much you use in the dashboard, and you can add more storage without moving your media anywhere. G7Cloud is hosted in the UK, on servers we own and run ourselves. See the storage on each plan.

Frequently asked questions

Does offloading media to S3 make WordPress faster?

Not by itself, and often the opposite. Serving straight from a bucket is usually slower than serving from your own server. The speed comes from a CDN in front, which you can add without offloading anything.

When is offloading WordPress media worth it?

When storage itself is the limit: a very large media library, backups slowed down by it, several servers that need the same files, or storage cost. Below about 20 GB it is rarely worth the complexity.

Should I delete local files after offloading?

Not for at least two weeks, and not until every image is checked. The local copy is your only way back if the URL rewriting is wrong or the plugin stops being maintained.

Why are my images broken after offloading?

Almost always because URLs inside post content were not rewritten; many plugins only update the attachment records. Fix them with wp search-replace, which handles serialised data. Never use a raw SQL UPDATE.

Which storage region should a UK site use?

One in the UK or western Europe. A US region adds a transatlantic round trip to every request the CDN has not cached. Your contracts may also say where customer data must be held.

Can I undo a media offload?

Yes, if you kept the local files: reverse the URL rewriting with wp search-replace and deactivate the plugin. If the plugin deleted them, you must copy everything back from the bucket first, which takes time and costs egress fees.

Put this into practice on G7Cloud

Every site runs in its own dedicated container behind ScaleShield, with daily backups that are restore-tested every night. Start on the free plan, no card needed.

About G7Cloud Engineering

Platform team

Articles written by the engineers who build and run G7Cloud: UK managed hosting and the AI Website Builder. We write about what we operate every day: containers, backups, databases, and the small-business websites that run on them.

More about G7Cloud →