WordPress Development Stack Exchange is a question and answer site for WordPress developers and 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

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


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.