Don’t prepend WordPress base url to image paths
You cannot insert remote file in this manner. <?php wp_insert_attachment( $attachment, $filename, $parent_post_id ); ?> $filename (string) (optional) Location of the file on the server. Use absolute path and not the URI of the file. The file MUST be in the uploads https://codex.wordpress.org/Function_Reference/wp_insert_attachment You should first download it to temp dir. If you wish to … Read more