Copy the wp-content/uploads folder, keep the same folder structure, and update media URLs only if the domain or path changes. For how to move WordPress…
Last updated: November 29, 2026
Quick Answer: copy the wp-content/uploads folder, keep the same folder structure, and update media URLs only if the domain or path changes. For how to move WordPress media library files for an auto blog without broken image URLs, the core fix is simple: copy the files first, then replace the old URL paths, then verify that attachments and thumbnails still load. In most migrations, that takes 3 checks, not one.
Key Takeaways
- Auto blog imports often split image links, featured images, and attachment IDs across different places.
- Move the media library in 3 steps: copy files, fix URLs, then check for old paths.
- Copying uploads usually avoids duplicate attachment records and new IDs.
- After the move, use search and replace on the old upload path or old domain.
What usually breaks image URLs?
Broken image URLs usually come from three problems: the files were moved, but the URLs were not updated; the media attachments stayed in the database, but the files are missing from the wordpress uploads directory; or the posts still point to the old domain, subfolder, or CDN path. On an auto blog, the first failure is common because image-heavy imports often store direct file links, featured images, and attachment IDs in different places.
The safest fix is often to start with the file path, but only as a practical first step. WordPress stores uploaded media under wp-content/uploads/ by year and month unless the site uses a different structure. If you move only the database and skip that folder, the media library can still show records, but the image files may not exist where WordPress expects them.
A second common cause is a domain or protocol change. If the old blog used http://oldsite.com and the new one uses https://newsite.com, the image file may still exist, but the post HTML can still point to the old URL. Search and replace tools are made for this kind of cleanup.
A third cause is attachment mismatch. WordPress stores media as attachment records, and posts may reference those records by ID or by plain URL. That means one broken import can leave the media library looking fine while the post content still breaks.
For background on the file system side, the WordPress documentation for wp-content/uploads is a useful starting point, and the media library attachment docs help explain the database side.
How do I move the media library safely?
You move the media library safely by copying the files first, then fixing URLs, then checking the database for old paths. That order matters because file copies are cheap, but a bad replace can damage every post on the site. If the migration involves a large auto blog or a shared production database, it is wise to consult a professional and follow the WordPress media handling guidance before making changes.
Follow this procedure in order:
- Copy the entire
wp-content/uploadsfolder from the old site to the new site. Keep the same subfolders, including the year and month folders. That preserves the file paths WordPress expects. - Confirm the destination site has the same media directory structure. If the old site used
/2024/06/folders, the new site should show the same path pattern unless you intentionally changed it. - Move or import the WordPress database after the files are in place. If the attachment records arrive first, WordPress can point at files that are not there yet.
- Check the site URL and home URL in the database or WordPress settings. If the domain changed, image links in post content may still use the old domain.
- Run a search and replace tool on the old media URL or old upload path. Replace the old domain or folder path with the new one, but do not rewrite random strings that only look similar.
- Rebuild thumbnails after the move. WordPress creates multiple image sizes, and some themes call a size that is not the original file.
- Load a few posts, the media library, and featured images. You want to see the correct image file, not just a blank media record.
The cleaner approach is to treat the file copy and the URL fix as separate jobs, and it is safest to verify that with the WordPress media docs before touching live content. If you mix them together, it becomes hard to tell whether a broken image comes from a missing file, a wrong attachment ID, or an old URL stored in post content.
Should I copy or re-import the files?
Copying the files is usually safer than re-importing them, because re-importing can create duplicate attachment records and new IDs. That is a problem for auto blogs that already rely on existing attachment IDs, featured images, or image references in content.
Here is the practical difference:
| Method | What it does | Main benefit | Main risk | Best use |
|---|---|---|---|---|
Copy wp-content/uploads |
Moves the physical image files | Keeps original file paths intact | Old URLs still need replacing | Full site move |
| Re-import media | Pulls files into the new site again | Can rebuild missing media library entries | Can create duplicates and new attachment IDs | Damaged or incomplete library |
| Hotlink images | Leaves files on the old site | Fast to set up | Broken images if the source site changes or blocks requests | Temporary testing only |

Copying is the right choice when the goal is to move an auto blog without breaking existing content. Re-importing is useful only when the source media folder is damaged, incomplete, or impossible to copy. Hotlinking is the least stable option because the new site depends on the old site’s file access and uptime.
The trade-off is time versus certainty. Copying the uploads folder and fixing the URLs takes more setup, but it gives you a local file set that the new site controls. Re-importing sounds easier, but it can create a fresh set of attachment IDs that no longer match the posts already published.
If the reader wants a technical transfer workflow for the full site, this page fits under the broader WordPress auto blog migration technical transfer process, but the media library should still be handled as its own step.
How do I fix image URLs after the move?
You fix image URLs after the move with a search and replace tool that targets the old upload path or old domain. That is often the fastest way to update post content, excerpt fields, and builder data that still point at the source site.
The replacement should usually match the exact old domain or exact old file path, not a loose partial match. For example, replacing every appearance of oldsite.com/wp-content/uploads with newsite.com/wp-content/uploads is cleaner than replacing just the domain if both sites use the same folder structure. If the folder structure changed, update the full path carefully so you do not break file names that appear in other fields.
A search and replace tool is also where you handle protocol changes. If the source used http:// and the new site uses https://, some posts may keep the old protocol inside image tags. That can trigger mixed content warnings in browsers, even when the file itself exists.
One thing to avoid is blanket database editing with no filter. WordPress stores serialized data in some places, and a bad replace can corrupt settings. Use a tool that understands WordPress database formats, or limit the replacement to the exact media path you need to change.
The WordPress developer documentation on the Media Library is useful for understanding how attachments are stored and why a URL change can affect more than one field. That matters because a featured image, a gallery, and a pasted image URL can each live in a different part of the database.
What about attachment IDs and featured images?
Attachment IDs matter because the media library stores each uploaded file as a database record, and many themes link featured images by that record instead of by raw URL. If those IDs change during import, the post may still exist while the featured image slot goes empty.
That is why a simple file copy is better than a fresh re-import when the goal is to preserve an auto blog. If the database moves with the site and the uploads folder stays intact, the attachment IDs are more likely to remain usable. If the files are imported again into a new library, WordPress can assign new IDs, which may not match what the posts expect.
Featured images deserve special care because they often appear in loops, archives, and cards. A post body image may fail quietly, but a missing featured image can make the whole homepage look unfinished. That is not just cosmetic; on an auto blog, it can make a large batch of posts look half-built after migration.
The fix is to verify the attachment record and the file path together. If the attachment ID exists but the file is missing, copy the file into the proper uploads subfolder. If the file exists but the post still shows no featured image, the post may be pointing at the wrong attachment ID or an old media record from the source site.
This is also why a media move is not the same task as comparing source and destination content. A post can match on text and still fail on images if the attachment mapping is off.
How do I check for hotlinking and missing thumbnails?
You check for hotlinking and missing thumbnails by loading posts in a browser, then checking whether the image request points to the old site or a local file path. If the image loads from the source domain, the new site is still hotlinking instead of hosting the file itself.
Hotlinking checks matter because the page may look fine on day one and fail later if the old server blocks requests or the file is removed. A site that depends on hotlinked media is fragile by design. For an auto blog, that makes routine publishing risky because every new post inherits the same outside dependency.
Thumbnail checks matter for a different reason. WordPress creates multiple image sizes, and the theme may call a medium, large, or custom size instead of the original file. If those generated files are missing, the media library can still show the full-size image while the front end shows a broken or stretched version.
The fix is to regenerate thumbnails after the file move. That rebuilds the sizes that WordPress and the theme expect. If the source site used custom image sizes, the new site needs those sizes registered too, or the rebuild will not create them.
A quick browser check helps here: open a post, inspect the image source, and see whether it points to the local uploads folder or the old site. If the path is still external, the copy step did not solve the whole problem.
What should I do before I publish the moved blog?
You should check the media library, a few published posts, and the uploads path before you put the moved blog back into routine use. That last check catches the mistakes that are easy to miss when the dashboard still looks normal.
Start with the media library itself. Open several attachment records and confirm the file name, the date folder, and the preview image. Then open posts that contain inline images and posts that depend on featured images. If one works and the other fails, the problem is usually URL replacement or attachment mapping, not the file copy.
Next, look at the old and new uploads paths. If the source used a different folder structure, a search and replace step may still be incomplete. That is common when the site moved from one domain to another or from one WordPress install to another without a matching uploads path.
Then check a few images in a browser with cache cleared. A cached image can hide a bad path for a while, which makes the migration look finished when it is not. Once the cache expires, the broken URL shows up again.
The honest limitation is simple: if the auto blog used mixed media sources, no single copy step will fix everything. Local uploads, hotlinked images, and rebuilt thumbnails each need a different check. The safe move is to treat the media library as a file system job, a database job, and a front-end job, and to consult a professional if the site is large or revenue-critical.
How do you know if media urls changed after migration?
You know media URLs changed when the image source in the post no longer matches the old uploads path or old domain. A browser view of the image file, plus a search and replace check in the database, usually reveals it quickly. If the file loads from a new local path, the move worked; if it still points to the source domain, it did not.
What happens to attachment ids when you move media?
Attachment IDs stay tied to the WordPress database record, not the file name alone. If you copy the database and uploads folder together, the IDs are more likely to remain useful. If you re-import media into the new site, WordPress can create new IDs, which may leave featured images or other references pointing at the wrong record.

Should I copy the uploads folder or re-import media?
Copy the uploads folder in most cases, because it keeps the file paths and media structure closest to the source site. Re-import only when the source media is missing, damaged, or impossible to copy cleanly. For an auto blog, copying is usually the safer choice because it reduces the chance of duplicate files and broken attachment references.
Drafted with AI; not yet reviewed by a person.