Title: Replacing PDF links
Last modified: August 21, 2016

---

# Replacing PDF links

 *  [justinjwilson](https://wordpress.org/support/users/justinjwilson/)
 * (@justinjwilson)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/replacing-pdf-links/)
 * I wanted to know if this plugin would allow me to switch the hundreds of PDF 
   links from the old site (not WordPress-built), and import the PDFs into the media
   library and update the link. Is this possible? If not, is there a plugin that
   can – not just for images?
 * [https://wordpress.org/plugins/media-helpers/](https://wordpress.org/plugins/media-helpers/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Fabien Quatravaux](https://wordpress.org/support/users/fab1en/)
 * (@fab1en)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/replacing-pdf-links/#post-4623679)
 * With media-helpers plugin, it is possible to save **a link** to a PDF file as
   a WordPress Media in the media library, and then insert it into your posts. But
   it is not possible to automate this task and convert all your existing links 
   into WordPress Media. That could be a nice feature request.
 * By the way, as soon as the PDF is inserted into the post, you don’t need to have
   it registered in your library. This plugin does not upload the files you create
   into your WordPress install, it just create a “fake” media that points to an 
   external link. The real file is not copied into the WordPress uploads directory.
 *  Thread Starter [justinjwilson](https://wordpress.org/support/users/justinjwilson/)
 * (@justinjwilson)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/replacing-pdf-links/#post-4623681)
 * I see. There’s a plugin called Media Tools that does something like what I mentioned,
   but it’s only for images. I’m wondering if there’s a plugin out there that can
   do this for different media types, not just images. I’m struggling to finish 
   this site before Friday and I just became aware that the previous developer did
   not add any of the media, and the links are all externally pointed at the old
   site’s files!
 * I’d assume you’re pretty good at PHP, so do you know if there’d be an easy way
   to automate something like this? If not, any plugins you know of (premium or 
   free)?
 *  Plugin Author [Fabien Quatravaux](https://wordpress.org/support/users/fab1en/)
 * (@fab1en)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/replacing-pdf-links/#post-4623682)
 * I think the easiest way to do this is to use the WordPress Importer tool. You
   just have to build an XML file listing all the media, with titles and direct 
   links, and WordPress Importer tool will create the media for you and download
   all the files.
 * Here is an example XML file that can be used this way :
 *     ```
       <?xml version="1.0" encoding="UTF-8" ?>
       <rss version="2.0"
       	xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
       	xmlns:content="http://purl.org/rss/1.0/modules/content/"
       	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
       	xmlns:dc="http://purl.org/dc/elements/1.1/"
       	xmlns:wp="http://wordpress.org/export/1.2/"
       >
   
       <channel>
       	<wp:wxr_version>1.2</wp:wxr_version>
       	<item>
       		<title>test imported Media</title>
       		<wp:post_type>attachment</wp:post_type>
       		<wp:attachment_url>http://www.pdf-accessible.com/IMG/pdf/manuel-balisage-acrobat_AcceDe.pdf</wp:attachment_url>
       	</item>
       </channel>
       </rss>
       ```
   
 * To test it, just save the code above in a file called test.xml, then go to the
   Tools > Import > WordPress menu, and send this file.
 * Then, the next question is : how to build this XML file listing all the PDFs 
   from your old site. Was it a static HTML site ?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Replacing PDF links’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/media-helpers_fcfcfc.svg)
 * [media helpers](https://wordpress.org/plugins/media-helpers/)
 * [Support Threads](https://wordpress.org/support/plugin/media-helpers/)
 * [Active Topics](https://wordpress.org/support/plugin/media-helpers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/media-helpers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/media-helpers/reviews/)

## Tags

 * [links](https://wordpress.org/support/topic-tag/links/)
 * [media](https://wordpress.org/support/topic-tag/media/)
 * [pdf](https://wordpress.org/support/topic-tag/pdf/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * 3 replies
 * 2 participants
 * Last reply from: [Fabien Quatravaux](https://wordpress.org/support/users/fab1en/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/replacing-pdf-links/#post-4623682)
 * Status: not resolved