Antelope Instagram Import
A WordPress plugin to automatically import an Instagram export into WordPress.
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/markbiek/alf-ig-import/archive/refs/heads/main.zipThis is a very rough plugin which takes an Instagram export .zip and imports all of the image media items. The actual image files are added to the Media Library. A post (added to the selected category) is created for each media item and the image file is set as the Featured Image. If any Instagram post is a slideshow of multiple images, only the first image will be imported.
The import plugin includes and activates the Action Scheduler which can be accessed at /wp-admin/tools.php?page=action-scheduler. The import will be divided into chunks and each chunk will run as a separate scheduled action.
How to use
NOTE: Running this import will automatically create new posts for each imported item. Keep in mind that these new posts may show up in your RSS feed and send notifications or emails to all of your subscribers. If you have 1000 imported items, your subscribers will be notified/emailed 1000 times. You may want to take steps to disable sending emails during the import.
_The plugin now sets WP_IMPORTING to true but I haven't tested if it works properly._
You could temporarily disable email sending during import by creating a dummy plugin called wp-content/plugins/disable-email.php with the contents:
<?php
/**
* Plugin Name: Disable Email Sending
* Description: When active, WordPress will not send any emails.
*/
add_filter('wp_mail', '__return_false');
- Install and activate this plugin.
- Get an export of your Instagram data.
- Upload the exported
.zipfile to theuploads/directory of your WordPress site. - Go to "Tools -> Instagram Import" in the
wp-adminof your site. - You should see a pull down with your Instagram
.zipfile. - Select the category you want to have your photo posts added to.
- Click "Import" and wait. You can refresh the admin page and it will show you where it is in the process.
Troubleshooting
I highly recommend installing the https://wordpress.org/plugins/debug-log-manager/ plugin so you can see what the import is doing or if there are any errors.
You can cancel an in-progress import by clicking "Reset Import" on the admin page.
There is a cli command which will delete ALL POSTS AND MEDIA (not just those imported by this plugin) if you need to do a complete reset. Run wp alf-ig-import to see the name of the command. NOTE: The command is disabled by default. You'll need to remove a line of code to enable it. That's an exercise for you to figure out since that command is super dangerous.
In the event that something goes wrong and you go to the admin page and the "Import" button isn't visible, you'll need to delete the following WordPress options:
alf_process_instagram_importalf_complete_instagram_importalf_instagram_import_statusalf_instagram_export_path
You may also need to run as_unschedule_all_actions( 'alf_process_instagram_import' ); to cancel any import scheduled actions that are stuck.