• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

REQ Plugin Instagram to Wordpress

iluhin

Member
May 5, 2022
77
19
8
Hi, everyone!

Pls help me! I cant find in global internet this plugin. I want import my posts from Instagram to wordpress. Not embed i meen. 1:1 1 instagram post = 1 wordpress blog post.

i have over 6000 posts
 
I personally don't know if such plugin exists. But here's an idea:

Why don't you try to use some language model out there and write a simple import script. You can also look into custom post types with custom fields in Wordpress. May be create a plugin that populates those fields with scraped data. For scraping you can look at Python libraries and may be add a cronjob.
 
  • Like
Reactions: m1ngo
Hi, everyone!

Pls help me! I cant find in global internet this plugin. I want import my posts from Instagram to wordpress. Not embed i meen. 1:1 1 instagram post = 1 wordpress blog post.

i have over 6000 posts

I am providing you your start point, because you need create custom plugin for this functionality.

Code:
<?php
/**
 * Plugin Name: IG to WP
 * Description: A plugin to import Instagram posts to WordPress
 * Version: 1.0
 * Author: Your Name
 */

// Instagram API endpoint
define('INSTAGRAM_ENDPOINT', 'https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=');

// Your Instagram Access Token goes here
define('INSTAGRAM_ACCESS_TOKEN', 'your-access-token-here');

// Fetch Instagram Posts
function fetch_instagram_posts() {
    $url = INSTAGRAM_ENDPOINT . INSTAGRAM_ACCESS_TOKEN;
    $response = wp_remote_get($url);
    $body = wp_remote_retrieve_body($response);

    if (!is_wp_error($body)) {
        return json_decode($body, true);
    }

    return null;
}

// Convert Instagram Post to WordPress Post
function instagram_to_wordpress_post($instagram_posts) {
    if (!empty($instagram_posts)) {
        foreach ($instagram_posts['data'] as $post) {
            $post_exists = get_page_by_title($post['id'], OBJECT, 'post');

            // Skip if post already exists
            if ($post_exists) {
                continue;
            }

            $post_data = [
                'post_title' => $post['id'],
                'post_content' => $post['caption'],
                'post_status' => 'publish',
                'post_type' => 'post',
            ];

            // Insert the post into WordPress
            $post_id = wp_insert_post($post_data);

            // Add Featured Image
            if ($post['media_type'] === 'IMAGE') {
                // Download and attach image here
            }
        }
    }
}

// Execution logic
function execute_import() {
    $instagram_posts = fetch_instagram_posts();
    instagram_to_wordpress_post($instagram_posts);
}

// Schedule the event
if (!wp_next_scheduled('execute_import')) {
    wp_schedule_event(time(), 'hourly', 'execute_import');
}

add_action('execute_import', 'execute_import');

If you can't make it yourself, contact me and discuss details.
 
  • Like
Reactions: iluhin
I am providing you your start point, because you need create custom plugin for this functionality.

Code:
<?php
/**
 * Plugin Name: IG to WP
 * Description: A plugin to import Instagram posts to WordPress
 * Version: 1.0
 * Author: Your Name
 */

// Instagram API endpoint
define('INSTAGRAM_ENDPOINT', 'https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,thumbnail_url,permalink&access_token=');

// Your Instagram Access Token goes here
define('INSTAGRAM_ACCESS_TOKEN', 'your-access-token-here');

// Fetch Instagram Posts
function fetch_instagram_posts() {
    $url = INSTAGRAM_ENDPOINT . INSTAGRAM_ACCESS_TOKEN;
    $response = wp_remote_get($url);
    $body = wp_remote_retrieve_body($response);

    if (!is_wp_error($body)) {
        return json_decode($body, true);
    }

    return null;
}

// Convert Instagram Post to WordPress Post
function instagram_to_wordpress_post($instagram_posts) {
    if (!empty($instagram_posts)) {
        foreach ($instagram_posts['data'] as $post) {
            $post_exists = get_page_by_title($post['id'], OBJECT, 'post');

            // Skip if post already exists
            if ($post_exists) {
                continue;
            }

            $post_data = [
                'post_title' => $post['id'],
                'post_content' => $post['caption'],
                'post_status' => 'publish',
                'post_type' => 'post',
            ];

            // Insert the post into WordPress
            $post_id = wp_insert_post($post_data);

            // Add Featured Image
            if ($post['media_type'] === 'IMAGE') {
                // Download and attach image here
            }
        }
    }
}

// Execution logic
function execute_import() {
    $instagram_posts = fetch_instagram_posts();
    instagram_to_wordpress_post($instagram_posts);
}

// Schedule the event
if (!wp_next_scheduled('execute_import')) {
    wp_schedule_event(time(), 'hourly', 'execute_import');
}

add_action('execute_import', 'execute_import');

If you can't make it yourself, contact me and discuss details.
yes i wrote u! thx!!! i need this!!!
 
I personally don't know if such plugin exists. But here's an idea:

Why don't you try to use some language model out there and write a simple import script. You can also look into custom post types with custom fields in Wordpress. May be create a plugin that populates those fields with scraped data. For scraping you can look at Python libraries and may be add a cronjob.
if u know how release this, pls help me
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock