Not every site runs on WordPress. A corporate PHP application, a content system you built yourself or a small custom site may all want to publish blog posts. What these sites share is the lack of a ready-made door through which content can safely arrive. When you open that door, you want to avoid two things: an open endpoint that anyone can post to, and the same article being saved twice.
This article explains how controlled publishing works on non-WordPress sites with Autodigy's Custom PHP connector. One warning first: this option needs a developer. The interface says the same.
Why is there a separate route outside WordPress?
WordPress has a ready-made publishing interface (the REST API) and an authentication mechanism, and Autodigy connects to them. A custom site has neither. You define how content enters the site. For that, Autodigy offers a small bridge with a defined contract: a connector package that runs on your site, and a standard request that Autodigy sends to it.
There are two supported publishing targets: WordPress and Custom PHP. There is no ready-made connector for other CMS platforms; on those systems you can adapt the Custom PHP bridge on your side, but that is development work.
How the connector works
The package is a small PHP application that you copy into your site. It exposes only these endpoints:
- GET /api/ping: is the connector up?
- GET /api/migration-status: are the database tables ready?
- GET /api/capabilities: which features does the connector support (for example multilingual targets)?
- OPTIONS /api/posts and POST /api/posts: the endpoint for sending a post.
Four security properties are part of the contract from the start:
- Token protection. Every endpoint requires a Bearer token. Without a token, endpoints return 401.
- HTTPS only. Autodigy uses only HTTPS for outbound requests and does not send requests to local or private IP addresses.
- A repeatable request. The post request carries an
Idempotency-Key. A second request with the same key and the same content does not create a new record; it returns the earlier result (the post's ID and address). The same key with different content is rejected with 409.
- Validation. Fields such as title, URL slug and status are checked; if they are invalid the response is 422 and nothing is saved.
The package includes a ready entry file for these endpoints, MySQL and SQLite schemas and the connector class. The schemas do not drop your existing tables; they only add a new table for storing posts.
One important detail: the connector stores the incoming content's HTML as it is. The display layer is yours. Your site's template decides how to show the content and which HTML security policy applies. The sample connector returns the record's address in the form /posts/<slug>; you need to prepare a page or a redirect on your site that actually serves that address.
The setup flow
Order matters; each step is a prerequisite for the next.
- Download the package. When you choose Custom PHP on the site connection screen, the Download connector package button gives you the ZIP. There is also an option to send the setup instructions to your developer.
- Copy it into the site and install it. Put the package in the site project and install its dependencies; route only
/api/* paths to the connector's entry file at the web server.
- Prepare the database. Apply the schema file for your database type. If you want multilingual publishing, apply the second-version schema (
v2) as well.
- Put secrets in environment variables. The database connection, the token and the HTTPS site address should come from the server's secret mechanism. Do not write the token into the repository.
- Test the connector. With the token, check the
ping and migration-status responses, and confirm that a request without the token returns 401.
- Save the site in Autodigy. In the site form, choose Custom PHP as the platform, enter the HTTPS site address and put the token in the API token field. Secret values are stored encrypted and are never displayed again.
- Test the connection. The Test connection button makes only read and probe requests; it creates no content. You need to save the site first.
- Publish a trial post. Publish a small approved piece, check the returned ID and address in the publishing history, and check the real page on your site.
The approval gate applies on this route too
The connector type does not change the approval rule. Content going to a Custom PHP site follows the same path as content going to WordPress: AI produces a draft, a person approves, and approved content enters the publishing queue. The connector is only the last step, not the decision step. Unapproved content does not reach the connector. For the details of this flow, see the editorial approval article.
Multilingual sites
If your site publishes in several languages, Autodigy adds target details such as language, category and path prefix to the publishing request. If the connector's capabilities do not report multilingual metadata support, Autodigy does not publish in multiple languages and shows this as an error; it does not create a post in a partial or wrong language. That is why applying the v2 schema and checking the capabilities response is part of setup.
When something goes wrong
Connector responses are classified in Autodigy: 401 authentication, 403 permission and 422 validation errors are permanent, so retrying does not help; 409 conflict, 429 rate limit and 503 service unavailable are transient and are retried. Each failure arrives with a suggested action, for example "Check the connector access token." For details, see the publishing failures article.
If the database migration is not complete or the publishing endpoint cannot be found, the connector reports it as 503 without leaking details; in Autodigy you see a message such as "The connector database migration is incomplete."
Security notes
- Keep the token narrow. Use a token created only for this connector and not used anywhere else.
- Rotate the token on a schedule. When its owner or lifetime changes, update it both on the server and in Autodigy.
- Filter HTML in the display layer. The connector stores HTML; apply your own security policy before showing it on a page.
- Take a backup. Rolling back the multilingual schema deletes the saved target details; back up first.
A short checklist
- Has a developer taken ownership of the setup?
- Is the token in an environment variable and not in the repository?
- Does a request without the token return 401?
- Was the trial post published and does it look right on the site?
- If multilingual publishing is needed, was the
v2 schema applied?
Related articles