Title: Create image attachments
Last modified: March 6, 2021

---

# Create image attachments

 *  Resolved [Eduard Armstrong](https://wordpress.org/support/users/p4r0dy/)
 * (@p4r0dy)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/create-image-attachments/)
 * Hello! Im making an import where i have the image filenames for one post. But
   i want to create the image attachment for the imported posts even if the file
   doesnt exist (i will fix this later). Basically what after i import the posts
   and i access to the post it gives me the 404 error for all images. Its there 
   a way to do this?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/create-image-attachments/#post-14192364)
 * Hi [@p4r0dy](https://wordpress.org/support/users/p4r0dy/),
 * > But i want to create the image attachment for the imported posts even if the
   > file doesnt exist (i will fix this later). Basically what after i import the
   > posts and i access to the post it gives me the 404 error for all images. Its
   > there a way to do this?
 * Unfortunately, there is no built-in way to generate a new placeholder image in
   the case that an image doesn’t exist. You may be able to do it using custom code(
   [https://www.wpallimport.com/documentation/developers/custom-code/inline-php/](https://www.wpallimport.com/documentation/developers/custom-code/inline-php/))
   and our API ( [http://www.wpallimport.com/documentation/developers/action-reference/](http://www.wpallimport.com/documentation/developers/action-reference/)),
   but I’m afraid I don’t have any examples for this specific use case.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/create-image-attachments/#post-14225170)
 * Hey [@p4r0dy](https://wordpress.org/support/users/p4r0dy/),
 * I’m marking this as resolved since it’s been inactive for a while. You can still
   follow up in this thread if you have questions.
 * Anyone else, please open up a new topic.
 *  Thread Starter [Eduard Armstrong](https://wordpress.org/support/users/p4r0dy/)
 * (@p4r0dy)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/create-image-attachments/#post-14225288)
 * Its not solved. But ok.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create image attachments’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Eduard Armstrong](https://wordpress.org/support/users/p4r0dy/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/create-image-attachments/#post-14225288)
 * Status: resolved