Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ini_set('memory_limit', '2056M');
- ini_set('max_execution_time', 900);
- $params = array(
- 'posts_per_page' => 1000,
- 'post_type' => 'attachment'
- );
- $q = new WP_Query( $params );
- if( $q->have_posts() ) :
- while( $q->have_posts() ) : $q->the_post();
- wp_delete_post( $q->post->ID, true );
- endwhile;
- endif;
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement