Script To Download Your Entire Media Library

Script To Download Your Entire Media Library
Written by Gearloose

If you have a free blog hosted to and you want to move it to another domain, or if you want to have a local backup to your PC, you will see that you can't download your entire media library.

You only can download the entire xml export file and by using the WP import plugin, to import every data including your images, but sometimes and especially if you have thousands of images, WP importer doesn't import everything.

This is a problem I had in some blogs I asked to help for, so I wrote this simple script to do this job.

Download the index.php file from here, and upload in a temporary folder in your server (like "temp"), or you can use AMPPS.

No go to your admin panel and select Tools -> Export.

From there, select "Media" and click on "Download" Button.

Unzip the file you received from WordPress and upload/move it in the folder you have the "index.php" file. Now open the "index.php" file with a txt editor and at the line 32, enter the filename of your xml file, eg:

If you have multiple xml files, wait until all the images of every file have been copied, and then change the settings and continue with another xml file.

Point your browser to this file, for example:
and wait for it to finish. If the browser freeze or you see no other folders/images inside the folders but the icon of your browser working, you can close this tab and re-run it again. Don't worry, it will skip the photos that already have been copied.

When done, you should have your photos in an "uploads" folder. You can upload this folder to your wordpress uploads folder or keep them as a backup.

Your blog must be visible in order this script to work.

Note that this script is for hosted blogs. You can install plugins like this, for your own hosted WordPress blog. However, if you do the same steps, it should work on every WordPress media library.

About the author



Καλώς ήρθατε στο blog μου. Το όνομα μου είναι Άκης Μπαρέκας. Είμαι freelance web developer και ασχολούμαι χρόνια (και παράλληλα παρέχω υπηρεσίες σχετικά) με το SEO, το Website Migration (την μεταφορά του περιεχομένου ενός site, πχ μεταφορά από blogger σε WordPress), το optimization ενός site και το web scraping (την εξαγωγή δηλαδή περιεχομένου από ένα ή περισσότερα sites.

Παράλληλα κάνω και τα πρώτα μου βήματα σαν game developer (στο unity κυρίως) και animator (blender). Επίσης φτιάχνω διάφορα, είτε για δουλειά, είτε για χόμπι. Όταν έχω χρόνο, ανεβάζω videos στο YouTube, γράφω tutorials, μοιράζομαι τεχνολογικά νέα στο Facebook και στο blog ή γράφω άρθρα που αφορούν το χρήμα και την οικονομία.

Leave a Comment