Mysql – Is it possible to add files to the “WordPress Media Library” using the command line

command-line-interfaceMySQLWordpress

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.

Best Answer

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.

Related Topic