$args = array( 'post_type' => 'attachment', // you want to show attachments 'posts_per_page' => -1 // all of them // other params ); $attachments = new WP_Query($args); print_r($attachments); exit();