Disable auto-resizing of uploaded images, but only for certain filename

Please Try Below Codes: add_filter( ‘intermediate_image_sizes_advanced’, ‘prefix_remove_default_images’ ); function prefix_remove_default_images( $sizes ) { if (preg_match(‘/(hd)/’, get_attached_file( $attachment_id )) { unset( $sizes[‘small’]); // 150px unset( $sizes[‘medium’]); // 300px unset( $sizes[‘large’]); // 1024px unset( $sizes[‘medium_large’]); // 768px return $sizes; } } And You can use Stop Generating Unnecessary Thumbnails WordPress Plugin to disable for all images size … Read more

How can I create more upload paths, like a post corresponding to a post title folder used to store images of the same product

This probably isn’t the whole solution for you as you didn’t post any code, so I can’t incorporate what I know with anything, however, the following snippet will upload an image into a custom directory, made at the time of execution, as the attachment. I’ve commented the key lines… function upload_to_new_dir() { global $post; //This … Read more