Deliver to WordPress
On this page
Set it up #
In WordPress #
Use a user whose role is Author or above. An Author can create posts and upload the picture; a Contributor can create drafts but not upload media, so the picture is left off (see the troubleshooting below). Make a user just for Brenzuri if you can: the name you give it appears as the author of the drafts. Open Users › Profile for that user and scroll to Application Passwords. Type a name such as “Brenzuri”, press Add New Application Password, and copy the password WordPress shows. It is shown once. Spaces in it do not matter. Check the site is reachable over https and that /wp-json/answers. Application passwords need https, and some security plugins and hosts switch off the REST API or strip theAuthorizationheader; those need an exception for this user.
In Brenzuri #
Open Connections › New connection and choose WordPress. Name it. Enter the Site address as the address that serves /wp-json, for examplehttps://example.com. If WordPress lives in a folder, include the folder.Enter the Username and the Application password. They are never shown again; leave them empty on a later edit to keep the stored ones. Choose a policy. Draft and Awaiting approval both deliver a draft; see below. Press Test connection. A pass says “Reached the site and authenticated. Drafts can be created.” Then Save connection and attach it to a site from the site’s Setup.
What happens, and when #
A person approves an article of the site in Brenzuri. The approved version is delivered to the site’s connection at once. A Beat that writes for the site delivers its article unapproved. A person, or a key or an agent with the exportscope, can deliver by hand withPOST /articles/{id}/deliver. For a key or an agent the result is always a draft.A workspace rule can stop it first: approval required before export, or no export while a claim is flagged.
What arrives #
| In WordPress | What it holds |
|---|---|
draft. Brenzuri sends no other status. When a person delivers by hand on a connection set to Awaiting approval, the delivery is marked awaiting approval in Brenzuri and is still a draft in WordPress. | |
<h1>, the text, and a sources note at the end with the line “Generated with sources · reviewed by a human: yes or no”. A theme that prints the post title will show the title twice; delete the <h1> or hide it in the theme. | |
draft. The one language field, lang, is sent only for an article that has language versions, and for each of them; see Language versions below.
Language versions #
lang: the language code, with bs sent for BHS. Brenzuri does nothing else with it: it does not link the posts of one article to each other in WordPress, and a site with no multilingual setup ignores the field. A version of an article a Beat wrote is a draft like everything else. A language version has no illustration of its own, so its post has no featured image from Brenzuri.
The featured image #
?post=<id>), and under an opaque file name, illustration- and eight characters of the illustration’s id, for example illustration-3f9a1c7e.png. Both are deliberate. WordPress gives an attachment the status of its parent, so the picture of a draft is not listed publicly, and an upload with no parent is published on its own. The file itself is still reachable by anyone who has its address, which is why the name is random: it carries no word of the title, so nobody can read a draft’s title from the address of its picture, and nobody can guess the address.
| Step | WordPress request |
|---|---|
POST /wp-json/wp/v2/posts, or /posts/{id} to update | |
GET /wp-json/wp/v2/posts/{id}?_fields=featured_media&context=edit | |
POST /wp-json/wp/v2/media?post={id}, the raw image bytes | |
POST /wp-json/wp/v2/media/{id} | |
POST /wp-json/wp/v2/posts/{id} with featured_media. No status is sent on this call, so a draft stays a draft. |
Updates and rewrites #
When a person approves a rewrite of an article that Brenzuri already delivered to this connection, the delivery updates the same post instead of making a second one. A rewrite is a new article started with supersedes; the post of the article it replaces is the one updated.An update replaces the title, content, slug and excerpt with the new version’s. An update changes the featured image only when the illustration is a different one, and never removes one. A featured image someone set by hand is kept. Before it uploads anything, an update reads the post’s current featured image. It replaces it only when the post has none, or when it is the picture Brenzuri attached itself the last time. Anything else is left alone, nothing is uploaded, and the delivery log says “Kept the post’s own featured image.” If the post cannot be read, the log says “Kept the post’s own featured image: it could not be checked.” A post that was just created is not read first. A version that is not approved always makes a new post, never an update.
The two policies #
Troubleshooting #
| What the log or the test says | Cause | What to do |
|---|---|---|
Authorization header or blocks the REST API. | /wp-json with Basic authentication for this user. | |
/wp-json, or pretty permalinks are off on a host that needs them. | /wp-json/ in a browser. Use the address that answers, folder included. Turn on pretty permalinks in Settings › Permalinks. | |
/wp-json answers normally, then retry from the log. | ||
upload_max_filesize and post_max_size for the site; pictures are at most 4 MB. | ||
/wp-json/wp/v2/media answers a normal upload for this user. | ||