Title: Process selected posts feature?
Last modified: December 28, 2016

---

# Process selected posts feature?

 *  Resolved [techsmurfy](https://wordpress.org/support/users/techsmurfy/)
 * (@techsmurfy)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/process-selected-posts-feature/)
 * I’ve successfully imported the images from the last 3 months, until I got a timeout.
   
   But I’m importing images from a 7-year old newspaper (over 70k) so right now 
   the plugin is of no use to me, as it now constantly encounters a “PHP Fatal error:
   Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes)”
   or “PHP Fatal error: Maximum execution time of 30 seconds exceeded”.
 * As it will be impossible for the plugin to work on such a huge database on the
   specs of a shared server, I think it would be really useful if the author could**
   implement a semi-bulk feature, that is selecting for example which MONTH’s posts
   you’d like to import images from**, rather than loading them all at once.
 * I know that IF it starts importing, it goes smoothly with that ‘process 50 posts
   at a time’, but the problem lies BEFORE processing. It won’t even load the plugin
   page, and when it finally does, after pressing “Import Attachments Now” nothing
   happens. If I could just move past these steps and start processing, it will 
   be fine.

Viewing 1 replies (of 1 total)

 *  Thread Starter [techsmurfy](https://wordpress.org/support/users/techsmurfy/)
 * (@techsmurfy)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/process-selected-posts-feature/#post-8622922)
 * Solved this in import-external-attachments.php by replacing all 3 instances of:
 * `$posts = get_posts( array( 'numberposts' => -1 ) );`
 * with
 *     ```
       //$posts = get_posts( array( 'numberposts' => -1 ) );
       $posts = get_posts( array( 'numberposts' => 2500, 'offset'=> 0 ) );
       ```
   
 * Basically it checks only the last 2500 posts. If you want it to check the next
   2500 after that, you edit the **offset** value (for example if you enter 2499
   instead of 0, it will check posts 2500 to 5000 and so on). Helps with very large
   databases and media libraries.
 * Hopefully a similar solution can be applied to many plugins that can’t process
   this huge amount of posts/media.

Viewing 1 replies (of 1 total)

The topic ‘Process selected posts feature?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/import-external-attachments.svg)
 * [Import external attachments](https://wordpress.org/plugins/import-external-attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/import-external-attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/import-external-attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/import-external-attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/import-external-attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/import-external-attachments/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [techsmurfy](https://wordpress.org/support/users/techsmurfy/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/process-selected-posts-feature/#post-8622922)
 * Status: resolved