Replace an inaccessible WordPress PDF by first reviewing the corrected file, then tracing every public route that should deliver it. A new upload is not the end of the task. Visitors may arrive through a page link, a File block, an old direct URL, a search result, or a cached copy. Decide which routes remain valid and verify the result through those routes.
Map the media item and its public references
WordPress's attachment documentation explains media attachments and their relationship to content. Record the media item, direct PDF URL, attachment page if used, and the pages that link to it. Do not assume that editing a media title changes the file URL or that a new attachment automatically replaces references to an older one.
For a fictional visitor guide, the PDF might appear on the venue page, an access-information page, and an event announcement. Search the site content and any controlled navigation areas for the old URL. Include embedded previews and download buttons. If third parties link directly to the old file, preserving an appropriate route may matter even after all internal links are updated.
Prepare and identify the reviewed replacement
Complete the document review before publishing the replacement. Check the guide's structure, reading order, diagrams, links, and content accuracy, then record its filename, revision, and a reliable file identifier such as a checksum. Keep the previous release according to the site's records and rollback process. A replacement should be attributable to an approved source rather than an unexplained file on an editor's desktop.
| Approach | What to verify | Common oversight |
|---|---|---|
| Keep the existing public file route | The route now serves the reviewed bytes and appropriate response | A cache continues serving the previous PDF |
| Publish at a new URL | Internal links and any approved old-route redirect | An old direct link remains an unintended alternative |
| Update a File block or preview | Both embedded content and download target | The label changes while the underlying file remains old |
Choose a supported replacement method
Use the site's established, maintained workflow and test it in staging. If a plugin manages replacement, verify its installed version and documented behavior, including file URLs and metadata. Do not assume every replacement tool preserves an attachment identity, a filename, or a path in the same way.
The official WP-CLI media replace documentation currently marks that command as not part of a stable WP-CLI release. That matters when copying instructions: confirm availability in the installed command set rather than treating it as a universal production command. There is no need to move a production site to a nightly tool merely to follow this article.
If the approved workflow creates a new media item, update the relevant references and decide how the old direct URL should behave. Use a redirect only when it accurately represents the intended replacement. An unrelated destination or an HTML summary is not automatically a suitable substitute for a requested full document.
Review the surrounding page and File block
WordPress's File block documentation describes file links, download controls, and PDF display options. Inspect the actual block settings and rendered page after replacement. Confirm the link's purpose, file type, and any displayed size or revision information. A correct PDF behind a misleading label still creates a poor reading experience.
Test the preview and direct download separately. If an embedded viewer is difficult to use, provide an evaluated route to the document without relying on the embed alone. Use the embedded-viewer guide for keyboard and focus checks. The downloadable file still needs its own accessibility review.
Verify delivery after publication
- Open each controlled public link in an ordinary visitor session and confirm the expected destination.
- Download the PDF and compare its identity with the reviewed replacement.
- Check the old URL and any approved redirect, including the final response and file type.
- Refresh or invalidate the relevant caches through the site's supported process, then test again where a stale result was observed.
- Review the rendered page, keyboard route, preview, and download label on desktop and mobile.
Record the publication time, replacement method, changed routes, and observed results. For search handling, use the PDF canonical and indexing guide rather than assuming an upload immediately changes search results. Keep rollback information available until the published routes have been checked, and preserve the accessibility evidence for the exact file visitors receive.
Frequently asked questions
Does uploading a new PDF update every old WordPress link?
A new upload may create a separate media item and URL. Trace the old references and verify the chosen replacement method, then test page links, embedded previews, direct URLs, and the actual downloaded file.
Can I assume wp media replace exists in stable WP-CLI?
The official command page currently marks media replace as outside a stable WP-CLI release. Check the installed command set and use a supported, tested replacement workflow instead of assuming the documentation describes every production installation.
Why do visitors still receive the old PDF after replacement?
Possible causes include unchanged links, a different media URL, a preview pointing to the old attachment, or a cached response. Compare the delivered file with the reviewed replacement and investigate each route rather than judging from the editor's screen alone.
Sources
The statements above rest on the primary sources below. Where a source is a law or standard, the version and date named in the text are the ones checked on the review date. This guide is general information, not legal advice.
- WordPress: Image and file attachments
- WordPress: File block
- WP-CLI: media replace . Documentation marks the command as not yet part of a stable WP-CLI release at this article's review date.
Keep reading
Embedded PDF accessibility: keyboard and focus
Test the page, embedded viewer, and PDF together, including frame labels, keyboard entry and exit, visible focus, mobile use, and direct access.
Read the guide →PDF SEO: canonicals, indexing, and HTML
Choose how PDF and HTML versions should appear in search, configure the appropriate response headers, and verify delivery without promising rankings.
Read the guide →SharePoint PDF accessibility and version workflow
Build a SharePoint PDF review process around document versions, approval evidence, reader permissions, and checks on the file people actually receive.
Read the guide →