is it possibile to post in wordpress the featured image as hotlink (external url), without hosting the image on the server?
See the line that should be fixed:
"featured_image": 'https://upload.wikimedia.org/wikipedia/it/f/fc/Pippo_Disney.png'
in
postDict = {
"title": 'Hi',
"content": 'My Content',
"date": '2020-08-17T10:16:34',
"featured_image": 'https://upload.wikimedia.org/wikipedia/it/f/fc/Pippo_Disney.png', # IMPORTANT
}
If it is not possibile, any ideas to do that is really welcome, thank you
3
Answers
By default, WordPress doesn’t support external links for featured images. However, there’re some plugins implementing this feature:
You’ll have to research their source code to understand how to use them from the REST API.
There is a simple trick for this. You can paste a link for external img for example to excerpt, and then you can get this url by using get_the_excerpt
https://developer.wordpress.org/reference/functions/get_the_excerpt/.
In posts listing use
Just insert image as HTML and it will auto-make it the featured image
"<img src={img} width="900" height="400" />"
https://wordpress.org/plugins/auto-post-thumbnail/
(Use old version of plugin, New version is broken)