• Resolved Snuggy

    (@snuggy)


    Please help. My host provider is not happy I have 100k images in one folder (wp-content/uploads/2016/12). When I am importing the XML all images are downloaded into this folder despite I have set random dates of posts.
    I need to map images into more directories, the best into YY/MM/DD. I tried it with Custom Upload Dir plugin, but it doesn′t work.
    What am I doing wrong?
    It is enough to map YY/MM as standard WordPress does, but I need to map it with date of post (random date) not with today′s date. Please help…

    • This topic was modified 8 years, 2 months ago by Snuggy.
Viewing 1 replies (of 1 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hi @snuggy

    You can use the WordPress filter upload_dir for this. Here’s a basic example that adds a date to the uploads folder:

    add_filter( 'upload_dir', 'add_date_to_upload_dir' );
    
    function add_date_to_upload_dir( $param ) {
        $date = date( 'd' );
        $dir = '/' . $date;
        $param['path'] = $param['path'] . $dir;
        $param['url'] = $param['url'] . $dir;
        return $param;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Too many images in 1 dir’ is closed to new replies.