WordPress Plugin: PDFs Open in New Tab

I had a client recently where I had to import over 150 pages into their site in order to get the moved over to WordPress. I didn’t have access to the database as it was a proprietary CMS they were using, so I ended up having to use HTTrack to take an offsite copy of the entire site. Needless to say, I ended up writing a few tools to import everything so I wouldn’t have to do it manually. I uploaded all of the html files to the server, sideloaded all of the images, set the first attachment as the featured image, and was done in probably 1/10th of the time it would have taken to go through them all one by one and copy and paste. Then I realized that all of the attached PDF files opened in the same tab. I could handle this one of three ways:

  1. Find and replace in the database
  2. Javascript or jQuery to append the target attribute
  3. Use WordPress hooks and some fancy Regex

I opted for number 3, as it would be basically transparent, and wrote a quick plugin. This can easily be adapted to work with any extension of attachment. Here we go:


How to transfer email accounts and messages between servers?

Moving emails to your new server should be relatively easy – if you want to transfer your email messages from one server to another, you can now do this with only your login details. No FTP transfers needed, and you don’t need to drag and drop between accounts in your mail program. It utilizes the IMAP protocol so it will sync everything for you directly without removing email from your old server.  It will transfer your entire email directory structure to the new server, including all sub folders that you select. You can now easily transfer emails from your previous host to your new host without any effort.

The script is finally complete, and you can find it here: http://brendancarr.ca/migrateemail/

Please note, it doesn’t actually transfer emails, but it will let you test the email transfer procedure itself and supports SSL so you can use it on Gmail.  Please feel free to contact me if you would like to utilize it.