How to Upload a Binary Image in WordPress?

Hi all!
Help me understand the logic behind loading a featured image for an article in WordPress. I read all similar requests, but I still haven’t fully figured it out.

I have a finished image in binary format which I received in the previous HTTP block. I know that i need new HTTP block to load it into the desired post. I understand that a post ID is required and you must first create the post itself and then add an image to it, knowing the post ID from the previous step.

What URL is correct to upload image?
mysite/wp-json/wp/v2/posts/ID_POST_TO_UPDATE?
After upload i don’t see the foto in post…

If I understand correctly, I skipped the step of uploading the image to the Wordpress media library, and I need to insert the image ID after uploading to Input Data Field Name. The question then is what should an HTTP block with image loading look like?

The problem is solved, the solution is in this post

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

n8n version: 1.68.0
Database (default: SQLite): PostgreSQL
n8n EXECUTIONS_PROCESS setting (default: own, main): default: own, main
Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
Operating system: Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-125-generic x86_64)

Hi @maksilo,

Thanks for posting! Glad you managed to find a solution - as you’ve already figured out you can use the HTTP request node to make a custom API call as mentioned in this post here: Wordpress Post featured image returns get request - #3 by EmeraldHerald (I’m just adding the link here so that it’s easier for others to find it :slight_smile: )