Drupal Integration
Connect BlogSEO to your Drupal site to automatically publish AI-generated articles directly to your content, with full support for rich text, tables, a cover image, inline images, taxonomy, SEO fields, custom URL slugs, and drafts. Connect with the BlogSEO module from drupal.org (recommended), or with a username and password through Drupal core's JSON:API.
Two ways to connect
- The BlogSEO module (recommended): install the module, paste a connection key, and you're done. There's no password to share, and JSON:API can stay read-only for everyone else. Requires Drupal 10.3 or 11.
- A username and password: works on Drupal 9, 10 or 11 (or Drupal CMS) without installing anything, but you enable HTTP Basic Authentication and switch JSON:API to read-write yourself.
Either way, your site must be reachable from the public internet over HTTPS.
Connecting with the BlogSEO module
Installing the module
Install the module with Composer and enable it, like any other contributed module:
composer require drupal/blogseo
drush pm:install blogseo
You can also enable BlogSEO in Extend (/admin/modules) after the Composer step. Enabling it also enables Drupal core's JSON:API.
Connecting the site
- In your BlogSEO dashboard, go to Integrations → Drupal and click Connect with the BlogSEO module. A dialog shows your connection key.
- In Drupal, go to Configuration → Web services → BlogSEO (
/admin/config/services/blogseo). - Paste the connection key, choose the account BlogSEO publishes as, and click Connect.
Your Drupal site registers itself with BlogSEO, which checks the connection right away, and the dialog in BlogSEO closes on its own. If your site has an Article content type, BlogSEO selects it automatically; you can pick another one in the configuration dialog.
Use a dedicated editor account as the account BlogSEO publishes as, rather than an administrator. It needs permission to create and edit the content type BlogSEO publishes to; the optional permissions listed under Connecting with a username and password unlock the same extra features.
How the module keeps your site safe
- BlogSEO sends the connection key with each request, in an
X-BlogSEO-Keyheader. Drupal treats those requests as the account you chose, so its usual permission checks apply. - Whatever that account's permissions, requests carrying the key can only create and update content, media, files, and taxonomy terms. They can never delete anything or change user accounts.
- JSON:API stays read-only for everyone else. The module lets only requests carrying the key write, which you can turn off on the module's settings page if you'd rather switch JSON:API to read-write yourself.
- Drupal stores only a hash of the key, and Disconnect on the module's settings page invalidates it immediately.
Treat the connection key like a password, and keep proxies or logs in front of your site from recording the X-BlogSEO-Key header.
Connecting with a username and password
Requirements
Before connecting your Drupal site, make sure you have:
- A Drupal 9, 10 or 11 site (or Drupal CMS), reachable from the public internet over HTTPS.
- The core JSON:API and HTTP Basic Authentication modules enabled.
- JSON:API switched to accept all operations (read + write) — JSON:API is read-only by default.
- An account BlogSEO can sign in as: your administrator account works with no extra setup, or a dedicated user (see below).
Enabling JSON:API
BlogSEO publishes through Drupal's core JSON:API, which ships in read-only mode and must be switched to read-write.
- In Drupal, go to Extend (
/admin/modules) and enable JSON:API and HTTP Basic Authentication. Both are part of Drupal core — there is nothing to download or install. - Go to Configuration → Web services → JSON:API (
/admin/config/services/jsonapi) and select "Accept all JSON:API create, read, update, and delete operations", then save.
If you skip the read-write step, BlogSEO's connection test reports that JSON:API is in read-only mode. Switch the setting and try again.
Choosing an account
BlogSEO authenticates over HTTP Basic Auth with the username and password you provide.
The simplest option is your administrator account — it already has every permission, so there is nothing else to configure.
If you would rather not share administrator credentials, create a dedicated, least-privilege user instead:
- Go to People → Roles (
/admin/people/roles) and create a role (for example,API). - Go to People → Permissions (
/admin/people/permissions) and grant that role, for the content type you publish to (for example, Article):- Access content
- Create new content
- Edit any content
- To unlock optional features, also grant the role the permission below. BlogSEO publishes fine without them and falls back automatically:
- Use the Full HTML text format — for tables and full rich HTML (otherwise Basic HTML is used, which omits tables).
- Create and edit URL aliases — for custom URL slugs.
- Administer node published status — to publish in draft / unpublished.
- Administer content — to publish under a custom author.
- Create [image] media — only if your content type's image field uses Media (Drupal CMS).
- View media — to import your Drupal media library, so articles can use your own images instead of AI-generated ones.
The Test Connection button reports any of these permissions that are missing, so you can grant exactly what the features you want require.
4. Go to People → Add user (/admin/people/create), create a user, assign it the role, and set a strong password.
A dedicated user keeps the integration scoped to publishing content, instead of sharing administrator credentials. BlogSEO automatically skips any field the user is not allowed to set, so the minimal permission set is enough to publish.
Connecting BlogSEO to Drupal
- In your BlogSEO dashboard, go to Integrations → Drupal and click Connect with a username and password.
- Enter your Drupal site URL (for example
https://example.com). - Enter the Username and Password of your administrator account (or the dedicated user you created).
- Click Test Connection to verify, then Connect.
The connection test confirms your site is reachable, that JSON:API is enabled and read-write, and that the credentials are valid.
Selecting a content type
Drupal stores content in types ("bundles") such as Article, so after connecting you choose where BlogSEO publishes:
- On the Drupal integration page, click Select Content Type.
- Pick the content type you want articles published as (for example, Article).
- Save your selection. The integration becomes active once a content type is selected.
BlogSEO inspects a few of your existing posts of that type to learn its fields automatically — which field holds the body, the cover image, and tags — so it works even when your fields have custom names.
Choosing defaults (optional)
In the configuration dialog you can set:
- Default author — the Drupal user shown as the author on published articles. Leave empty to use the connected account.
- Body text format — the text format applied to the article body (for example, Full HTML).
- Field mapping instructions — free-text guidance for how BlogSEO should fill any extra fields on your content type (for example, "put a one-sentence summary in the Teaser field").
You can also override the author and tags per article from the article preview sidebar before publishing.
Publishing content
You have two options for publishing articles to Drupal:
- Auto-publish: enable auto-publish in the Drupal integration settings, and BlogSEO pushes articles to your site as soon as they are generated.
- Manual publish: from the dashboard, select a generated article and click Publish.
BlogSEO handles the publishing details for you:
- Rich text and tables: articles are converted to clean HTML so headings, lists, links, and tables render correctly.
- Cover image: uploaded to your Drupal site and attached to the content type's image field (file or media), with alt text. An image that already comes from your Drupal media library is referenced in place rather than uploaded again.
- Inline images: uploaded to your Drupal site when your body text format supports tracked editor images; otherwise they are linked from their original location.
- Taxonomy and extra fields: tags are attached to your taxonomy field, and any additional fields on your content type are filled by AI from the article (guided by your field mapping instructions).
- SEO and slug: the title, body, and a custom URL alias are set on the node.
- Updates: editing an article in BlogSEO and re-publishing updates the same node instead of creating a duplicate.
Using your own images instead of AI-generated ones
If you turn AI image generation off, BlogSEO imports your Drupal media library and picks covers and inline images from it. Your media appears on the Media page, where you can browse it, exclude individual images from article use, upload extra images, and re-assign images across your upcoming articles. Because these images already live on your Drupal site, publishing references your existing media entities instead of creating duplicate files.
The import needs the View media permission on the account BlogSEO uses. With a username and password, the Test Connection button tells you if it is missing.
Draft mode
When draft mode is enabled, articles are saved as unpublished content in Drupal (or moved to the Draft workflow state if your content type uses Content Moderation). You can review them in your Drupal admin and publish them manually when ready.
Troubleshooting
The module can't connect
- "BlogSEO could not be reached": your Drupal server can't make outgoing HTTPS requests to
app.blogseo.io. Check your firewall or proxy settings. - "BlogSEO doesn't recognize this connection key": the key was regenerated or the integration was deleted. Copy the current key from the dialog in BlogSEO and connect again.
- "Your Drupal site didn't receive the connection key": a proxy, CDN, or firewall in front of Drupal removes the
X-BlogSEO-Keyheader. Allow it through. - "Your Drupal site redirected BlogSEO": BlogSEO only sends the key to the exact address you connected from. Connect again from your site's final public address, or remove the redirect.
- Connect from the public address: the module registers the address you're browsing the admin from, so don't connect from a local or internal address.
JSON:API is in read-only mode
With a username and password, go to Configuration → Web services → JSON:API (/admin/config/services/jsonapi) and choose "Accept all JSON:API create, read, update, and delete operations", then reconnect. With the module, keep JSON:API read-only and make sure the option that lets BlogSEO write is on in Configuration → Web services → BlogSEO.
Connection test fails
- Check the credentials: use the username and password of the API user, and make sure the account is active.
- Check the modules: confirm both JSON:API and HTTP Basic Authentication are enabled.
- Permissions: the user's role needs create and edit permission on the content type you publish to.
- Firewall / network: make sure your Drupal site is reachable from the public internet over HTTPS so BlogSEO's servers can connect.
Images not appearing
BlogSEO downloads your article's images and re-uploads them to Drupal. If the original image URLs are behind authentication or have expired, the upload is skipped. Re-generate or re-upload the image in BlogSEO and publish again.
For additional support, contact our team through the in-app chat or at support@blogseo.io.