Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

up vote 3 down vote accepted

There's the add from server plugin http://wordpress.org/extend/plugins/add-from-server/ 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
add comment

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
add comment

Your Answer

 
discard

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.