{"id":8466,"date":"2026-01-15T20:38:41","date_gmt":"2026-01-16T04:38:41","guid":{"rendered":"https:\/\/www.ultimatewb.com\/blog\/?p=8466"},"modified":"2026-01-15T23:18:42","modified_gmt":"2026-01-16T07:18:42","slug":"how-to-automatically-share-your-wordpress-blog-posts-to-instagram","status":"publish","type":"post","link":"https:\/\/www.ultimatewb.com\/blog\/8466\/how-to-automatically-share-your-wordpress-blog-posts-to-instagram\/","title":{"rendered":"How to Automatically Share Your WordPress Blog Posts to Instagram"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1200\" height=\"574\" src=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-1200x574.jpg\" alt=\"WordPress, automatically post to Instagram\" class=\"wp-image-8473\" srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-1200x574.jpg 1200w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-500x239.jpg 500w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-768x367.jpg 768w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-150x72.jpg 150w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram-800x383.jpg 800w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-automatically-post-to-instagram.jpg 1530w\" sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\" \/><\/figure>\n\n\n\n<p>Sharing your blog posts on Instagram is a great way to increase reach and <a href=\"https:\/\/www.ultimatewb.com\/blog\/?s=engagement\">engagement<\/a> &#8211; but manually posting every article can be time-consuming. With this custom WordPress plugin, you can automatically share posts to Instagram <strong>manually with a button<\/strong>, or <strong>automatically with daily posts<\/strong>. Plus, it works even if your posts don\u2019t have images!<\/p>\n\n\n\n<p>In this tutorial, we\u2019ll guide you through setting up the plugin, configuring settings, and making sure every post has a valid image.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 1: Requirements<\/strong><\/h2>\n\n\n\n<p>Before starting, ensure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>WordPress site<\/strong> with admin access<\/li>\n\n\n\n<li>An <strong>Instagram Business or Creator account<\/strong><\/li>\n\n\n\n<li>Your Instagram account linked to a <strong>Facebook Page<\/strong><\/li>\n\n\n\n<li>A <strong>Facebook Graph API access token<\/strong> (Graph API Explorer)<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Instagram only allows posting images or videos via the API, so every post must have an image. This plugin ensures that by using featured images, the first image in post content, or generating an image automatically.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 2: Create the Plugin Folder<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>On your computer, create a folder named:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>wp-instagram-auto-post\n<\/code><\/pre>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>Inside that folder, create a file:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>wp-instagram-auto-post.php\n<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>(Optional) Add a <code>\/fonts\/<\/code> folder with a <code>.ttf<\/code> font, like <code>arial.ttf<\/code>, for dynamically generated images.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 3: Add the Plugin Code<\/strong><\/h2>\n\n\n\n<p>Copy and paste the following code into <code>wp-instagram-auto-post.php<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\/*\nPlugin Name: WP Instagram Auto Post\nDescription: Automatically post WordPress posts to Instagram manually or daily. Generates image if none exists. Configure access token, account ID, categories, and view error log.\nVersion: 1.4.1\nAuthor: UltimateWB Devs\n*\/\n\nif (!defined('ABSPATH')) exit;\n\nclass WP_Instagram_Auto_Post {\n\n    private $access_token;\n    private $instagram_account_id;\n    private $selected_categories;\n    private $instagram_errors = &#91;]; \/\/ For admin notices\n\n    public function __construct() {\n        \/\/ Load settings\n        $this-&gt;access_token = get_option('wp_instagram_access_token', '');\n        $this-&gt;instagram_account_id = get_option('wp_instagram_account_id', '');\n        $this-&gt;selected_categories = get_option('wp_instagram_categories', &#91;]);\n\n        \/\/ Admin, AJAX, Daily Posting\n        add_action('admin_menu', &#91;$this, 'register_admin_pages']);\n        add_action('add_meta_boxes', &#91;$this, 'add_instagram_button']);\n        add_action('wp_ajax_post_to_instagram', &#91;$this, 'post_to_instagram']);\n        add_action('wp_instagram_daily_post', &#91;$this, 'daily_random_post']);\n\n        if (!wp_next_scheduled('wp_instagram_daily_post')) {\n            wp_schedule_event(time(), 'daily', 'wp_instagram_daily_post');\n        }\n    }\n\n    \/** -------------------- COMBINED ADMIN PAGES -------------------- *\/\n    public function register_admin_pages() {\n        $this-&gt;add_admin_page();\n        $this-&gt;add_error_log_page();\n    }\n\n    \/** -------------------- SETTINGS PAGE -------------------- *\/\n    public function add_admin_page() {\n        add_menu_page(\n            'Instagram Auto Post',\n            'Instagram Auto Post',\n            'manage_options',\n            'wp-instagram-auto-post',\n            &#91;$this, 'admin_page_html']\n        );\n    }\n\n    public function admin_page_html() {\n        if (isset($_POST&#91;'wp_instagram_save'])) {\n            update_option('wp_instagram_access_token', sanitize_text_field($_POST&#91;'access_token']));\n            update_option('wp_instagram_account_id', sanitize_text_field($_POST&#91;'account_id']));\n            $cats = isset($_POST&#91;'categories']) ? array_map('intval', $_POST&#91;'categories']) : &#91;];\n            update_option('wp_instagram_categories', $cats);\n            echo '&lt;div class=\"updated\"&gt;&lt;p&gt;Settings saved!&lt;\/p&gt;&lt;\/div&gt;';\n            $this-&gt;access_token = get_option('wp_instagram_access_token');\n            $this-&gt;instagram_account_id = get_option('wp_instagram_account_id');\n            $this-&gt;selected_categories = get_option('wp_instagram_categories');\n        }\n\n        $categories = get_categories(&#91;'hide_empty' =&gt; false]);\n        ?&gt;\n        &lt;div class=\"wrap\"&gt;\n            &lt;h1&gt;WP Instagram Auto Post Settings&lt;\/h1&gt;\n            &lt;form method=\"post\"&gt;\n                &lt;table class=\"form-table\"&gt;\n                    &lt;tr&gt;\n                        &lt;th&gt;Instagram Access Token&lt;\/th&gt;\n                        &lt;td&gt;&lt;input type=\"text\" name=\"access_token\" size=\"50\" value=\"&lt;?php echo esc_attr($this-&gt;access_token); ?&gt;\" required&gt;&lt;\/td&gt;\n                    &lt;\/tr&gt;\n                    &lt;tr&gt;\n                        &lt;th&gt;Instagram Business Account ID&lt;\/th&gt;\n                        &lt;td&gt;&lt;input type=\"text\" name=\"account_id\" size=\"50\" value=\"&lt;?php echo esc_attr($this-&gt;instagram_account_id); ?&gt;\" required&gt;&lt;\/td&gt;\n                    &lt;\/tr&gt;\n                    &lt;tr&gt;\n                        &lt;th&gt;Select Categories for Auto Posting&lt;\/th&gt;\n                        &lt;td&gt;\n                            &lt;?php foreach ($categories as $cat): ?&gt;\n                                &lt;label&gt;\n                                    &lt;input type=\"checkbox\" name=\"categories&#91;]\" value=\"&lt;?php echo $cat-&gt;term_id; ?&gt;\" &lt;?php checked(in_array($cat-&gt;term_id, $this-&gt;selected_categories)); ?&gt;&gt;\n                                    &lt;?php echo esc_html($cat-&gt;name); ?&gt;\n                                &lt;\/label&gt;&lt;br&gt;\n                            &lt;?php endforeach; ?&gt;\n                        &lt;\/td&gt;\n                    &lt;\/tr&gt;\n                &lt;\/table&gt;\n                &lt;p&gt;&lt;input type=\"submit\" name=\"wp_instagram_save\" class=\"button button-primary\" value=\"Save Settings\"&gt;&lt;\/p&gt;\n            &lt;\/form&gt;\n        &lt;\/div&gt;\n        &lt;?php\n\n        \/\/ Admin notices for manual post errors\n        if (!empty($this-&gt;instagram_errors)) {\n            foreach ($this-&gt;instagram_errors as $error) {\n                echo '&lt;div class=\"notice notice-error\"&gt;&lt;p&gt;' . esc_html($error) . '&lt;\/p&gt;&lt;\/div&gt;';\n            }\n            $this-&gt;instagram_errors = &#91;];\n        }\n    }\n\n    \/** -------------------- POST EDIT BUTTON -------------------- *\/\n    public function add_instagram_button() {\n        add_meta_box('instagram_post_button', 'Instagram', &#91;$this, 'instagram_button_html'], 'post', 'side', 'high');\n    }\n\n    public function instagram_button_html($post) {\n        echo '&lt;button id=\"instagram-post-btn\" class=\"button button-primary\" data-postid=\"'.esc_attr($post-&gt;ID).'\"&gt;Post to Instagram&lt;\/button&gt;';\n        ?&gt;\n        &lt;script&gt;\n        jQuery(document).ready(function($){\n            $('#instagram-post-btn').on('click', function(e){\n                e.preventDefault();\n                var post_id = $(this).data('postid');\n                $.post(ajaxurl, {action:'post_to_instagram', post_id:post_id}, function(response){\n                    alert(response.data);\n                });\n            });\n        });\n        &lt;\/script&gt;\n        &lt;?php\n    }\n\n    \/** -------------------- AJAX POST TO INSTAGRAM -------------------- *\/\n    public function post_to_instagram() {\n        $post_id = intval($_POST&#91;'post_id']);\n        $post = get_post($post_id);\n        if (!$post) wp_send_json_error('Post not found.');\n\n        $image = $this-&gt;get_post_image($post);\n        if (!$image) {\n            $error_msg = 'No image could be generated for this post.';\n            $this-&gt;instagram_errors&#91;] = $error_msg;\n            $this-&gt;log_instagram_error($error_msg);\n            wp_send_json_error($error_msg);\n        }\n\n        $caption = wp_strip_all_tags($post-&gt;post_title . \"\\n\\n\" . wp_trim_words($post-&gt;post_content, 20));\n        $res = $this-&gt;instagram_post($image, $caption);\n\n        if ($res) wp_send_json_success('Posted to Instagram successfully!');\n        else wp_send_json_error('Failed to post to Instagram. Check the Error Log for details.');\n    }\n\n    \/** -------------------- GET IMAGE -------------------- *\/\n    private function get_post_image($post) {\n        $image = get_the_post_thumbnail_url($post-&gt;ID, 'full');\n        if ($image) return $image;\n\n        if (preg_match('\/&lt;img.+?src=&#91;\"\\'](.+?)&#91;\"\\'].*?&gt;\/i', $post-&gt;post_content, $matches)) {\n            return $matches&#91;1];\n        }\n\n        return $this-&gt;generate_post_image($post);\n    }\n\n    \/** -------------------- GENERATE IMAGE -------------------- *\/\n    private function generate_post_image($post) {\n        if (!function_exists('imagecreatetruecolor')) return false;\n\n        $width = 1080; $height = 1080;\n        $title = wp_strip_all_tags($post-&gt;post_title);\n\n        $image = imagecreatetruecolor($width, $height);\n        $bg_color = imagecolorallocate($image, 255, 255, 255);\n        imagefilledrectangle($image, 0, 0, $width, $height, $bg_color);\n        $text_color = imagecolorallocate($image, 0, 0, 0);\n        $font_size = 30;\n\n        $font_path = __DIR__ . '\/fonts\/arial.ttf';\n        if (!file_exists($font_path)) $font_path = null;\n\n        if ($font_path) {\n            imagettftext($image, $font_size, 0, 50, 500, $text_color, $font_path, $title);\n        } else {\n            imagestring($image, 5, 50, 500, $title, $text_color);\n        }\n\n        $upload_dir = wp_upload_dir();\n        $file_path = $upload_dir&#91;'path'] . '\/post_image_' . $post-&gt;ID . '.jpg';\n        imagejpeg($image, $file_path, 90);\n        imagedestroy($image);\n\n        return $upload_dir&#91;'url'] . '\/post_image_' . $post-&gt;ID . '.jpg';\n    }\n\n    \/** -------------------- ERROR LOG UTILITY -------------------- *\/\n    private function log_instagram_error($message) {\n        $errors = get_option('wp_instagram_error_log', &#91;]);\n        $errors&#91;] = &#91;'date'=&gt;date('Y-m-d H:i:s'), 'message'=&gt;$message];\n        update_option('wp_instagram_error_log', $errors);\n    }\n\n    \/** -------------------- POST TO INSTAGRAM API -------------------- *\/\n    private function instagram_post($image_url, $caption) {\n        if (empty($this-&gt;access_token) || empty($this-&gt;instagram_account_id)) {\n            $this-&gt;log_instagram_error('Access token or account ID is missing.');\n            return false;\n        }\n\n        $endpoint = \"https:\/\/graph.facebook.com\/v17.0\/{$this-&gt;instagram_account_id}\/media\";\n        $data = &#91;'image_url'=&gt;$image_url, 'caption'=&gt;$caption, 'access_token'=&gt;$this-&gt;access_token];\n        $response = wp_remote_post($endpoint, &#91;'body'=&gt;$data]);\n        $body = json_decode(wp_remote_retrieve_body($response), true);\n\n        if (!isset($body&#91;'id'])) {\n            $this-&gt;log_instagram_error('Error creating media: ' . wp_json_encode($body));\n            return false;\n        }\n\n        $publish_endpoint = \"https:\/\/graph.facebook.com\/v17.0\/{$this-&gt;instagram_account_id}\/media_publish\";\n        $publish_response = wp_remote_post($publish_endpoint, &#91;'body'=&gt;&#91;'creation_id'=&gt;$body&#91;'id'],'access_token'=&gt;$this-&gt;access_token]]);\n        $publish_body = json_decode(wp_remote_retrieve_body($publish_response), true);\n\n        if (!isset($publish_body&#91;'id'])) {\n            $this-&gt;log_instagram_error('Error publishing media: ' . wp_json_encode($publish_body));\n            return false;\n        }\n\n        return true;\n    }\n\n    \/** -------------------- DAILY RANDOM POST -------------------- *\/\n    public function daily_random_post() {\n        $args = &#91;'posts_per_page'=&gt;1,'orderby'=&gt;'rand','post_status'=&gt;'publish'];\n        if (!empty($this-&gt;selected_categories)) $args&#91;'category__in'] = $this-&gt;selected_categories;\n\n        $posts = get_posts($args);\n        if ($posts) {\n            $post = $posts&#91;0];\n            $image = $this-&gt;get_post_image($post);\n            if (!$image) {\n                $this-&gt;log_instagram_error(\"Daily post failed: no image found for post ID {$post-&gt;ID}.\");\n                return;\n            }\n            $caption = wp_strip_all_tags($post-&gt;post_title . \"\\n\\n\" . wp_trim_words($post-&gt;post_content, 20));\n            $this-&gt;instagram_post($image, $caption);\n        }\n    }\n\n    \/** -------------------- ERROR LOG ADMIN PAGE -------------------- *\/\n    public function add_error_log_page() {\n        add_submenu_page(\n            'wp-instagram-auto-post',\n            'Instagram Error Log',\n            'Error Log',\n            'manage_options',\n            'wp-instagram-error-log',\n            &#91;$this, 'error_log_page_html']\n        );\n    }\n\n    public function error_log_page_html() {\n        $errors = get_option('wp_instagram_error_log', &#91;]);\n        ?&gt;\n        &lt;div class=\"wrap\"&gt;\n            &lt;h1&gt;Instagram Error Log&lt;\/h1&gt;\n            &lt;?php if ($errors): ?&gt;\n                &lt;table class=\"widefat fixed\"&gt;\n                    &lt;thead&gt;\n                        &lt;tr&gt;&lt;th&gt;Date&lt;\/th&gt;&lt;th&gt;Error Message&lt;\/th&gt;&lt;\/tr&gt;\n                    &lt;\/thead&gt;\n                    &lt;tbody&gt;\n                        &lt;?php foreach ($errors as $e): ?&gt;\n                        &lt;tr&gt;\n                            &lt;td&gt;&lt;?php echo esc_html($e&#91;'date']); ?&gt;&lt;\/td&gt;\n                            &lt;td&gt;&lt;?php echo esc_html($e&#91;'message']); ?&gt;&lt;\/td&gt;\n                        &lt;\/tr&gt;\n                        &lt;?php endforeach; ?&gt;\n                    &lt;\/tbody&gt;\n                &lt;\/table&gt;\n                &lt;form method=\"post\"&gt;\n                    &lt;p&gt;&lt;input type=\"submit\" name=\"clear_instagram_errors\" class=\"button button-secondary\" value=\"Clear Log\"&gt;&lt;\/p&gt;\n                &lt;\/form&gt;\n            &lt;?php else: ?&gt;\n                &lt;p&gt;No errors logged.&lt;\/p&gt;\n            &lt;?php endif; ?&gt;\n        &lt;\/div&gt;\n        &lt;?php\n        if (isset($_POST&#91;'clear_instagram_errors'])) {\n            update_option('wp_instagram_error_log', &#91;]);\n            echo '&lt;div class=\"updated\"&gt;&lt;p&gt;Log cleared!&lt;\/p&gt;&lt;\/div&gt;';\n        }\n    }\n\n}\n\nnew WP_Instagram_Auto_Post();\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 4: Upload and Activate the Plugin<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Zip the <code>wp-instagram-auto-post<\/code> folder.<\/li>\n\n\n\n<li>Go to <strong>WordPress Admin \u2192 Plugins \u2192 Add New \u2192 Upload Plugin<\/strong>, upload the zip, and activate.<\/li>\n<\/ol>\n\n\n\n<p>Once activated:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>Post to Instagram<\/strong> button appears in the post editor.<\/li>\n\n\n\n<li>The plugin automatically posts <strong>one random post per day<\/strong> from the selected categories.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\">    <picture>\n                <source type=\"image\/webp\" srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button-150x116.webp 150w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button-500x386.webp 500w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button.webp 543w\" sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\">\n                <img src=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button.jpg\"\n             srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button.jpg 543w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button-500x386.jpg 500w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-post-to-instagram-button-150x116.jpg 150w\"             sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\"\n             width=\"543\"\n             height=\"419\"\n             alt=\"wp-post-to-instagram-button\"\n             loading=\"lazy\"             decoding=\"async\"\n             class=\"wp-image-8468\" >\n    <\/picture>\n    <\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 5: Configure the Plugin Settings<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In WordPress admin, go to <strong>Instagram Auto Post<\/strong> in the left menu.<\/li>\n\n\n\n<li>Enter your <strong>Instagram Access Token<\/strong> and <strong>Business Account ID<\/strong>.<\/li>\n\n\n\n<li>Select the <strong>categories<\/strong> you want to allow for automatic daily posting.<\/li>\n\n\n\n<li>Save settings.<\/li>\n<\/ol>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Now the plugin knows which posts to use for daily posting and how to connect to your Instagram account.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\">    <picture>\n                <source type=\"image\/webp\" srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-auto-post-to-instagram-settings-150x129.webp 150w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-auto-post-to-instagram-settings.webp 493w\" sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\">\n                <img src=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-auto-post-to-instagram-settings.jpg\"\n             srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-auto-post-to-instagram-settings.jpg 493w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wordpress-auto-post-to-instagram-settings-150x129.jpg 150w\"             sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\"\n             width=\"493\"\n             height=\"423\"\n             alt=\"wordpress-auto-post-to-instagram-settings\"\n             loading=\"lazy\"             decoding=\"async\"\n             class=\"wp-image-8469\" >\n    <\/picture>\n    <\/figure>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 6: Image Handling<\/strong><\/h2>\n\n\n\n<p>Instagram requires an image for every post. The plugin uses this <strong>fallback hierarchy<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Featured image<\/strong> &#8211; the primary image set in your post.<\/li>\n\n\n\n<li><strong>First image in post content<\/strong> &#8211; if no featured image is set.<\/li>\n\n\n\n<li><strong>Generated image<\/strong> &#8211; if no images exist, the plugin creates a 1080\u00d71080 image with your post title.<\/li>\n<\/ol>\n\n\n\n<p>This ensures every Instagram post always has a visual element, even for posts with no images.<\/p>\n\n\n\n<p>Example of a dynamically generated image:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\">    <picture>\n                <source type=\"image\/webp\" srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-auto-post-image-generation-150x142.webp 150w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-auto-post-image-generation.webp 427w\" sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\">\n                <img src=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-auto-post-image-generation.jpg\"\n             srcset=\"https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-auto-post-image-generation.jpg 427w, https:\/\/www.ultimatewb.com\/blog\/wp-content\/uploads\/wp-auto-post-image-generation-150x142.jpg 150w\"             sizes=\"(max-width: 600px) 100vw, (max-width: 1200px) 75vw, 1200px\"\n             width=\"427\"\n             height=\"404\"\n             alt=\"wp-auto-post-image-generation\"\n             loading=\"lazy\"             decoding=\"async\"\n             class=\"wp-image-8470\" >\n    <\/picture>\n    <\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 7: Manual Posting<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open any post in the editor.<\/li>\n\n\n\n<li>Click the <strong>Post to Instagram<\/strong> button in the sidebar.<\/li>\n\n\n\n<li>A confirmation alert will appear when the post is successfully sent to Instagram.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Step 8: Automatic Daily Posting<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The plugin automatically posts <strong>one random post per day<\/strong> from the categories you selected.<\/li>\n\n\n\n<li>It follows the same image fallback rules.<\/li>\n\n\n\n<li>No additional setup is required once your settings are saved.<\/li>\n<\/ul>\n\n\n\n<p>Tip: Test with a single post first to ensure everything works as expected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udee0\ufe0f <strong>How to Use the Instagram Error Log<\/strong><\/h2>\n\n\n\n<p>To help you troubleshoot issues when the plugin tries to post to Instagram &#8211; whether manually or automatically &#8211; we added a built\u2011in <strong>Error Log<\/strong> in your WordPress dashboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0e <strong>What It Does<\/strong><\/h3>\n\n\n\n<p>Whenever a post fails to publish to Instagram (for example due to an expired access token, missing permissions, or API errors), the plugin now logs the error message along with the date and time it happened. You don\u2019t need to debug raw API responses yourself &#8211; now you can view them in a user\u2011friendly table in your admin area.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udccb <strong>How to Find the Error Log<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In your WordPress admin, go to <strong>Instagram Auto Post<\/strong> in the left menu.<\/li>\n\n\n\n<li>Click the new submenu item <strong>Error Log<\/strong>.<ul><li>You\u2019ll see a list of logged errors &#8211; each with a date and the full message from the Instagram API.<\/li><li>This helps you quickly understand why a post didn\u2019t publish.<\/li><\/ul><em>(Insert a screenshot of the Error Log page here.)<\/em><\/li>\n\n\n\n<li>If you want to reset the log, just click <strong>Clear Log<\/strong> at the bottom.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0 <strong>Why This Is Useful<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>See exact API issues<\/strong>: Instead of a generic \u201cfailed to post\u201d message, you\u2019ll know if the token expired, permissions are missing, or image upload failed.<\/li>\n\n\n\n<li><strong>Covers manual and daily posts<\/strong>: Errors from both the <strong>Post to Instagram<\/strong> button and the daily auto\u2011post scheduler are logged here.<\/li>\n\n\n\n<li><strong>Helps with debugging<\/strong>: No need to edit code or check server logs &#8211; error details are right where you configure the plugin.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd01 <strong>Example Use Cases<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If the access token expires unexpectedly (a common issue with Meta\/Instagram integrations), you\u2019ll see a message explaining the token error so you can generate a new one.<\/li>\n\n\n\n<li>If the Instagram API returns an unsupported image error, the log will show that response so you know to resize or adjust your image.<\/li>\n<\/ul>\n\n\n\n<p>\ud83d\udca1 <strong>Tip:<\/strong> After fixing the issue (e.g., updating your access token), it\u2019s a good idea to <strong>clear the error log<\/strong> so future errors are easy to spot.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Optional Enhancements<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add logos or brand colors to dynamically generated images.<\/li>\n\n\n\n<li>Extend daily posting to multiple posts per day.<\/li>\n\n\n\n<li>Filter by custom taxonomies or tags instead of just categories.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Tips for Best Results<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Include at least one image in posts when possible for best visual appeal.<\/li>\n\n\n\n<li>Ensure your Instagram Business account is linked correctly to your Facebook Page.<\/li>\n\n\n\n<li>Keep your access token and account ID secure; do not share publicly.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u26a0\ufe0f <strong>WordPress Cron Dependence<\/strong><\/h3>\n\n\n\n<p>WordPress\u2019s internal cron doesn\u2019t run on a strict schedule by itself &#8211; it only runs on <strong>page loads<\/strong>. If your site gets little traffic, daily posting might not run on schedule.<br>Solution: Set up a real server cron to call <code>wp-cron.php<\/code> regularly. This is common practice with scheduled tasks.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u26a0\ufe0f <strong>GD Image Generation Needs GD Installed<\/strong><\/h3>\n\n\n\n<p>The plugin\u2019s third fallback uses GD functions (<code>imagecreatetruecolor()<\/code> etc.). If GD isn\u2019t installed\/enabled on the server, it gracefully returns false \u2014 but that means no image and the post will fail.<\/p>\n\n\n\n<p>You can check if GD is installed by creating a PHP file with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php phpinfo(); ?&gt;\n<\/code><\/pre>\n\n\n\n<p>and looking for GD in the output.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u26a0\ufe0f <strong>Instagram API Requirements<\/strong><\/h3>\n\n\n\n<p>You must ensure:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Instagram account is a <strong>Business or Creator<\/strong> account.<\/li>\n\n\n\n<li>It\u2019s linked to a <strong>Facebook Page<\/strong>.<\/li>\n\n\n\n<li>You have the correct access token with publish permissions.<\/li>\n<\/ul>\n\n\n\n<p>This aligns with how other auto\u2011post plugins work.<\/p>\n\n\n\n<p>If any of those are missing, posting will fail.<\/p>\n\n\n\n<p><strong>Disclaimer: <\/strong>This plugin uses the <strong>official Instagram Graph API<\/strong>. API restrictions or changes may affect functionality. Always test with a single post before enabling automated daily posting. Use at your own risk and ensure compliance with Instagram\u2019s Terms of Service.<\/p>\n\n\n\n<p>Related: <a href=\"https:\/\/www.ultimatewb.com\/blog\/8137\/do-you-really-own-your-wordpress-website\/\">Do you really own your WordPress website?<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ultimatewb.com\/blog\/7602\/why-wordpress-users-are-finally-switching-to-ultimatewb-10-data-driven-reasons\/\">Why WordPress Users Are Switching to UltimateWB: 10 Data-Driven Reasons<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ultimatewb.com\/blog\/7578\/why-wordpress-sites-score-low-on-pagespeed-and-how-ultimatewb-fixes-that\/\">Why WordPress Sites Score Low on PageSpeed \u2013 and How UltimateWB Fixes That<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ultimatewb.com\/blog\/7540\/what-makes-ultimatewb-easier-to-use-than-wordpress\/\">What Makes UltimateWB Easier to Use Than WordPress<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ultimatewb.com\/blog\/7414\/why-relying-on-wordpress-plugins-can-backfire-and-how-to-avoid-it\/\">Why Relying on WordPress Plugins Can Backfire (And How to Avoid It)<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/www.ultimatewb.com\/blog\/6495\/how-one-plugin-update-broke-a-wordpress-site-and-how-you-can-avoid-it\/\">How One Plugin Update Broke a WordPress Site \u2013 And How You Can Avoid It<\/a><\/p>\n\n\n\n<p><em>Got a techy\/website question? Whether it\u2019s about UltimateWB or another website builder, web hosting, or other aspects of websites, just send in your question in the\u00a0<a href=\"https:\/\/www.ultimatewb.com\/ask-david\">\u201cAsk David!\u201d form<\/a>. We will email you when the answer is posted on the UltimateWB \u201cAsk David!\u201d section.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sharing your blog posts on Instagram is a great way to increase reach and engagement &#8211; but manually posting every article can be time-consuming. With this custom WordPress plugin, you can automatically share posts to Instagram manually with a button, &hellip; <a href=\"https:\/\/www.ultimatewb.com\/blog\/8466\/how-to-automatically-share-your-wordpress-blog-posts-to-instagram\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[360,1504],"tags":[6397,6398,6391,6401,2105,3090,6396,6394,6393,2434,1974,6392,109,6400,1081,6395,6402,6399],"class_list":["post-8466","post","type-post","status-publish","format-standard","hentry","category-social-media","category-wordpress","tag-auto-post-to-instagram","tag-automatic-blog-sharing","tag-custom-wordpress-plugin","tag-daily-instagram-posts","tag-engagement","tag-font","tag-generate-instagram-image","tag-instagram-automation","tag-plugin-code","tag-reach","tag-social-media-integration","tag-ttf","tag-wordpress","tag-wordpress-instagram-plugin","tag-wordpress-plugin","tag-wordpress-plugin-development","tag-wordpress-tips","tag-wordpress-tutorial"],"_links":{"self":[{"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/posts\/8466"}],"collection":[{"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/comments?post=8466"}],"version-history":[{"count":16,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/posts\/8466\/revisions"}],"predecessor-version":[{"id":8491,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/posts\/8466\/revisions\/8491"}],"wp:attachment":[{"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/media?parent=8466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/categories?post=8466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ultimatewb.com\/blog\/wp-json\/wp\/v2\/tags?post=8466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}