All guides

How to Publish Blog Posts to WordPress or a Next.js Site Automatically

September 30, 20267 min readFact-checked

If you're running a business site on WordPress or a GitHub-based framework like Next.js, Astro, Hugo, Jekyll, or Gatsby, the manual publishing routine is usually the bottleneck, not the writing. Someone has to log in, format the post, set the featured image, check the slug, hit publish, and then remember to verify it actually went live. Do that regularly and it eats hours that could go toward talking to customers.

Automatic publishing means removing the manual steps between "the article is ready" and "the article is live and confirmed" — while keeping a human in control of what gets published and when. Below is how that works differently on WordPress versus a GitHub-based site, what to check before you automate anything, and what a full automated pipeline actually looks like end to end.

The Core Difference: WordPress vs. a GitHub-Based Site

Before automating publishing, it helps to understand that WordPress and GitHub-based sites (Next.js, Astro, Hugo, Jekyll, Gatsby) are fundamentally different publishing targets, and that changes what "automatic" means for each.

WordPress stores content in a database and serves pages dynamically. Automated publishing to WordPress typically works through:

  • The WordPress REST API, which lets an external tool create, update, and publish posts programmatically once it has valid credentials.
  • A dedicated plugin installed on the site, which handles authentication and post creation from inside WordPress itself.

GitHub-based sites are typically static or server-rendered from files in a repository. There's no live database to write to. Automated publishing here generally means:

  • Committing a new Markdown or MDX file to the correct content directory in the repository.
  • Triggering the site's build process, which regenerates the affected pages.
  • Waiting for the deploy to finish and then confirming the new page actually resolves.

This distinction matters because a tool or workflow built only for WordPress's REST API won't work for a Next.js site, and vice versa. If you're evaluating any publishing automation, the first question is: does it actually support your specific platform, or just WordPress?

Setting Up Automatic Publishing to WordPress

Option 1: WordPress REST API with Credentials

This gives an external service a way to authenticate to the REST API without relying on your main login password each time. Once connected, a publishing tool can:

  1. Authenticate using valid API credentials.
  2. Create a draft or published post via a request to the posts endpoint.
  3. Set the title, body, categories, tags, and featured image through the same request.
  4. Return a confirmation that the post ID exists.

The gap in a lot of DIY setups is step 4. Getting a successful response from the API confirms WordPress accepted the request — it does not by itself confirm the page is publicly reachable, correctly formatted, or unaffected by a caching layer or security setting. That verification step has to be built separately, and it's the part most manual scripts skip.

Option 2: A Purpose-Built Plugin

Installing a plugin on the WordPress site itself avoids managing raw API credentials directly and often handles formatting, image uploads, and category mapping more predictably than a generic API integration. This is the lower-friction path if you don't want to manage authentication yourself.

What to Check Before You Automate WordPress Publishing

  • Confirm your user role has publishing permissions (Editor or Administrator, not just Author, if you want scheduling and category control).
  • Check with your host or security plugin whether the REST API or XML-RPC access is restricted on your site — this varies by provider and configuration, so verify it directly rather than assuming either is open or blocked.
  • Decide whether automated posts should publish immediately or land as drafts for review first. A review step gives you a way to catch formatting or content problems before they're public, even if you move to full automation later.
  • Verify your permalink structure is finalized before automating, since changing URL patterns after articles are indexed can break existing links.

Setting Up Automatic Publishing to a Next.js or Other GitHub-Based Site

Static and hybrid frameworks require a file-based publishing flow instead of a database write.

  1. Content lives as files. Each blog post is typically a Markdown or MDX file in a folder like /content/blog/ or /posts/, with frontmatter for title, date, slug, and metadata.
  2. A commit adds the file. Automated publishing means creating a new branch or commit that adds the post file to the repository.
  3. A build is triggered. Pushing to the main branch (or merging a pull request) kicks off a build through your CI or hosting platform, which regenerates the static pages or rebuilds the relevant server-rendered routes.
  4. The deploy has to finish before the page exists. Unlike WordPress, where the post can appear as soon as the database write succeeds, a Next.js site isn't live until the build and deploy pipeline completes. How long that takes depends on your site size and hosting configuration — check your own build logs rather than assuming a fixed duration.
  5. Confirm the live page, not just the commit. A successful push doesn't mean the page is visible. The build could fail, the route could 404, or the content could be missing frontmatter the template expects. Checking the actual public URL after deployment is the only way to know the post is really live.

Practical Setup Options for GitHub-Based Publishing

  • Direct commits via the GitHub API: A script or service authenticates with a token scoped to the repository and commits new content files directly to the content directory.
  • Pull request workflow: Instead of committing straight to main, the automation opens a pull request with the new post, which a human merges after a quick review. This adds a manual checkpoint without giving up the automation of drafting and formatting.
  • CI as the trigger: Once a file lands in the repo, a connected build pipeline can run the build and deploy automatically, so no separate manual step is needed after the commit.

A Publishing Checklist That Works for Either Platform

Regardless of which platform you're on, a dependable automated publishing flow should include:

  • A defined source of truth for the article content (draft file, CMS entry, or generated text) before anything is pushed live.
  • Authentication that doesn't rely on a personal password shared across tools.
  • A decision point: does content publish immediately, or does a human review it first? This affects how much you can trust the pipeline unattended.
  • A step that opens the actual published URL after the publish or deploy action completes, and checks the page loads with the expected title and content — not just that an API call succeeded.
  • A schedule or trigger so posts go out at a predictable cadence rather than in ad hoc bursts.
  • A rollback or edit path if something publishes with an error.

That verification step — confirming the live page, not just the API response or the commit — is the one most manual automation setups skip, and it's the one that matters most. An API returning success or a commit landing in the repo tells you the request was accepted. It doesn't tell you a caching layer didn't block the update, a build didn't silently fail, or a template didn't drop half the content. Treat "published" and "confirmed live" as two separate checks, not one.

Where Pentra Fits

Pentra connects to WordPress through its own plugin, or to a GitHub-based site (Next.js, Astro, Hugo, Jekyll, Gatsby), and publishes each article on the schedule you choose, in either Autopilot (published automatically) or Review-first mode (you approve each article before it goes out).

The part described above as most often missing from manual setups — confirming the actual live page after publishing, not just the API or commit response — is built into how Pentra runs: after publishing, it opens the real page to confirm the exact article is live before considering the job done. Pentra also runs a fact-check on each article against the business facts you confirmed, before it ever reaches the publish step, so the automation isn't just about delivery mechanics but about what goes out the door in the first place.

The free plan includes 3 articles a month with no credit card required. That's enough to test the WordPress or GitHub connection and see how the live-page check behaves before committing to a higher publishing pace.

Try Pentra

Frequently Asked Questions

Can I automate publishing to WordPress without installing a plugin? Yes — the WordPress REST API with valid credentials lets external services create and publish posts without a plugin, though a plugin is often lower-effort to set up and maintain, and handles authentication and formatting inside WordPress directly.

Does automatic publishing to a Next.js site require redeploying the whole site? It depends on your framework and hosting setup. Fully static builds typically rebuild the whole site or the relevant static routes; some hosting platforms and frameworks offer incremental regeneration for individual pages, which can avoid a full rebuild for every new post. Check your specific hosting provider's documentation to confirm what your setup supports.

What's the risk of publishing automatically without a review step? The main risk isn't the automation itself — it's not knowing whether a post is actually live and correctly formatted until a customer or search engine finds a broken page first. Building in a live-page confirmation step, or a review-first mode, reduces that risk regardless of which platform you're on.

Related reading