Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $args = array(
- 'date_query' => array(
- array(
- 'column' => 'post_date_gmt',
- 'before' => '1 year ago',
- )
- ),
- 'posts_per_page' => -1,
- );
- $query = new WP_Query( $args );
- $the_query = new WP_Query( $args );
- if ( $the_query->have_posts() ) :
- while ( $the_query->have_posts() ) : $the_query->the_post();
- wp_delete_post( the_ID() );
- endwhile;
- endif;
- wp_reset_postdata();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement