SHARE
TWEET

Untitled

a guest Jun 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ini_set('memory_limit', '2056M');
  2. ini_set('max_execution_time', 900);
  3.  
  4. $params = array(
  5.     'posts_per_page' => 1000,
  6.     'post_type' => 'attachment'
  7. );
  8. $q = new WP_Query( $params );
  9. if( $q->have_posts() ) :
  10.     while( $q->have_posts() ) : $q->the_post();
  11.         wp_delete_post( $q->post->ID, true );
  12.     endwhile;
  13. endif;
  14. wp_reset_postdata();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top