Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Wordpress has it's own "Media Library" which is used when you upload images and other media for use in blog posts and pages. The advantage of the media library is that it automatically produces thumbnails of the images and the web interface gives you extra info such as who uploaded the image, which articles use the image, etc.

My question is, does anyone have any tips on interacting with the media library via the command line instead of using the Wordpress web interface?

For example, any ideas on how to add a image to the media library from the command line?

If I copy files to the media library directory (usually .../wp-content/uploads/YYYY/MM/) from the command line they do not show up in the Wordpress dashboard - I guess because there needs to be an associated database entry for the media to be registered with Wordpress.

share|improve this question
up vote 3 down vote accepted

There's the add from server plugin that you could certainly hack to do what you want. Or simply use it.

share|improve this answer
Thanks - I didn't know about this plugin. – Tom Mar 22 '10 at 10:15

You could probably write a bash script that emulated what happens in Wordpress in terms SQL queries directory creation etc. Or make the php files that do this run on the command line.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.