Take the 2-minute tour ×

I am using media_sideload_image function in WordPress to upload images automatically from another location on the web.

I want to add two more pieces of functionality.

  1. Add these images to a particular folder in my system, which I will specify once within the code.

  2. No thumbnails should be generated for these images, just import the image and put it in the folder, and attach to the post.

How can I achieve points 1 and 2? Thanks

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Ad 1) Take a look at wp_upload_dir.

Ad 2) Try remove_theme_support( 'post-thumbnails' );

share|improve this answer
I implemented your suggestion: [link]pastebin.com/azqhHnGU However the images are not getting attached to my posts (using media_sideload_image function). Within the post when I check the attached image, the url is incorrectly pointing to /uploads/imagefile.jpg instead of /uploads/wp-site-gallery/imagefile.jpg. Any idea for a fix? –  drtanz Dec 11 '11 at 23:09
deleted the other post, if you could provide more help on this problem that would be great, thanks. –  drtanz Dec 13 '11 at 9:35

Your Answer


