Sync moves the media a post uses. It is not a media library mirror and it is not a CDN. Knowing the difference saves confusion when a large file, an optimiser or a missing image is involved.
What travels
Only referenced attachments are exported. Sync finds them from the featured image, from wp-image-<id> classes in the content, from block JSON fields named id or ids, and from uploads URLs in the content that resolve to attachments. The filter staticscope_sync_post_attachments can add more. Only IDs that are attachments inside the uploads directory are considered.
That means an image in the library with no post pointing at it stays where it is. So does a file outside uploads. Remove an image from a post and future syncs stop carrying it, though its record and blob remain in the repository. Media is a shared library; Sync never deletes from it.
Storage and naming
Files are content-addressed: media/<git-blob-id> on the <branch>-media branch. The same photo on two sites is one blob, not two. The uploads path, such as 2026/11/photo.jpg, is preserved on import so URLs do not move.
If the same path exists locally with different bytes, WordPress’s wp_unique_filename() creates a new name. The attachment record uses the new path, and the document’s {{uploads}}/<old> references are rewritten to match. If a local file disappears, the next sync fetches it by blob and writes it back, regenerating attachment metadata on the way.
Attachment records are small JSON files on the content branch. The bytes live on the media branch. Media is uploaded in batches of at most 4 MiB per request, and a single file larger than that gets a batch of its own. Fetching goes in chunks of 20 blobs, with a fallback to the media branch tip when a host will not serve single objects. A text-only sync makes one content commit; media adds commits on the parallel branch.
The 25 MB cap
The default limit is 25 MiB (26,214,400 bytes) per file. It is a filter, not a field on the screen: staticscope_sync_media_max_bytes. Raise it in code if your host and your reviewers can cope with larger files. Lower it if uploads are slow or the repository is growing faster than you like.
A referenced file over the limit is not added to the attachment set or the media list. It is named in the warning notice with the current formatted limit, and it stays on this site. The notice tells you to reduce the file or raise the filter.
The post still travels without the file. Its content keeps {{uploads}}/<path> for that attachment. Another site resolves that to its own uploads URL, where the file was never written, so the image is broken there. The warning says other sites will not receive it; it does not say the page will look right. Check over-limit posts on the other site.
What does not move
- Unreferenced media in the library.
- Files outside the uploads directory.
- Render-time image variants, including WebP or AVIF produced on the fly. An optimiser that rewrites the stored file syncs the smaller file naturally; one that only changes the delivered format does not.
- Attachment parent and relationship data.
- Post formats. Terms exclude
post_format. - Old files replaced by a new blob. The importer writes the new file and updates
_wp_attached_file; the old one can stay orphaned on disk. - Garbage collection. There is none on the media branch.
Media conflicts
When both sides change the same attachment record, the item is queued with the Media badge. The review screen shows a File fieldset with both pictures side by side, or document icons for other types, plus the file name, dimensions and size. Keep mine and Take theirs choose the file.
The file is separate from the alt text, title, caption and description. You can keep their picture and your wording, or the other way round. Under the API, a blob field choice moves blob, path, size, width, height and MIME type together, because those describe one file and splitting them would produce a record that points at nothing.
The preview is streamed through admin-ajax.php, not exposed as a public URL. It requires manage_options and a nonce, only serves an existing attachment conflict, and only sends JPEG, PNG, GIF, WebP or AVIF. It sets X-Content-Type-Options: nosniff and no-cache. Anything missing or invalid is a plain 404. Other file types get an icon and details rather than a preview.
Links between posts
Links are rewritten alongside media because they have the same problem: a URL that is correct on one site is wrong on another. A link written normally in the editor becomes a {{post:<uuid>}} token in the repository and resolves to each site’s own permalink. Query strings and anchors survive inside the token. A slug change is followed on the next sync, using WordPress’s remembered old slugs.
Only href attributes and block JSON fields named url, href, link or linkUrl are rewritten. A URL quoted in prose or a code sample is left exactly as written, and pre, code, script, style and textarea contents are protected. External hosts and #, mailto:, tel:, sms:, javascript: and data: links are left alone. Relative links such as /about/ are already portable and keep the author’s shape.
Links to category, tag and author archives are not post links. Use a root-relative URL if the sites live at different addresses. The filter staticscope_sync_internal_hosts teaches Sync about old, production or www hosts that belong to this site. A trashed target stays addressable because the importer searches trash and the old slug is remembered. If a target has no permalink at resolve time, the link falls back to home_url('/') rather than showing a raw token.
Practical limits
A content repository is not a delivery network. Every site stores its own copy of every referenced file, and every visitor is served by the site, not by Git. The repository is the transport, not the runtime.
- No video strategy. Referenced images only. Large unedited camera files are a bad fit; resize before upload.
- Host file-size and repository-size limits still apply. A file under 25 MB can still be rejected by GitHub or your server.
- No deletion and no garbage collection means the media branch only grows. Pruning is a repository job you do yourself, not something Sync does for you.
- Skipped files do not block a push. They are reported and retried on a later sync, so a broken image can stay missing if nobody reads the notice.
Next
- Conflicts and review: choosing between two versions of the same file.
- How a sync runs: when media is pushed relative to content.
- Notices and errors: skipped files, over-limit warnings and host errors.