WP Manifestindependent plugin directory
manifest / developer / unbatcher

REST Unbatcher (Loopia)

WordPress plugin that splits /batch/v1 REST calls into individual requests for hosts that block the batch endpoint.

by Nappe · github.com/theantiherose/unbatcher · website

0stars
0forks

Install

The author publishes release zips, so WP-CLI can install straight from GitHub:

wp plugin install https://github.com/theantiherose/unbatcher/releases/download/v1.0.0/unbatcher.zip

Readme

Loopia REST Unbatcher

Your block editor silently breaks because your host blocked /batch/v1. This plugin fixes it — no server config, no htaccess edits, no support tickets.

The problem

You fire up the WordPress block editor on a freshly installed site — and nothing works. Posts won't save. Previews don't load. The customizer spins. Open the browser console and it's full of this:

Failed to load resource: the server responded with a status of 403
batch/v1

What happened?

WordPress's block editor and customizer batch dozens of REST API calls into a single request to /wp-json/batch/v1. It's a smart optimization. But many shared hosts — Loopia and several others — block that endpoint at the web-server level for security reasons. WordPress silently falls back to making each call individually… and then it just doesn't, because core's fallback path was never finished for newer editor versions.

The result: the admin half-works, the editor half-breaks, and you can't figure out why.

The fix

Drop this plugin in. It intercepts every batch call in the browser via wp.apiFetch middleware and re-issues each sub-request individually, reassembling the responses in the exact format the batch endpoint would have returned. Your editor starts working again.

Zero server changes. Zero htaccess tweaks. Zero support tickets.

  • Pure client-side — nothing to configure on the host
  • Works as a regular plugin or as a must-use plugin
  • Recursion-safe, GET-safe, nonce-safe
  • Configurable concurrency and batch limits via filters
  • Built-in debug mode for verification

When you need this

You probably need Loopia REST Unbatcher if:

  • Your site is on Loopia (or another host that blocks POST /batch/v1)
  • The block editor throws 403/404 errors in the JS console on batch/v1
  • The customizer hangs on "Loading…"
  • Your client reports "the editor doesn't save anymore" after a host migration
  • You're running multisite on locked-down shared hosting

Install

As a regular plugin

cd wp-content/plugins
git clone https://github.com/theantiheroSE/unbatcher.git

Activate in PluginsInstalled Plugins.

As a must-use plugin (recommended for production)

cd wp-content/mu-plugins
git clone https://github.com/theantiheroSE/unbatcher.git

Done. Mu-plugins load automatically — no activation screen. The plugin auto-detects which mode it's running in.

The folder name must be unbatcher/ because WordPress mu-plugin loaders only auto-pick files matching the folder name.

Verify it's working

Append ?loopia_debug=1 to any admin URL. You should see a notice listing the detected mode, paths, and a ← TARGET marker next to unbatcher/unbatcher.php in the mu-plugin list.

Open the browser console on a post-edit screen and confirm there are no /batch/v1 4xx/5xx errors anymore.

Configuration

Two filters, both optional:

// Lower the batch size cap if you're hitting host request limits.
add_filter( 'loopia_unbatcher_max_items', fn() => 15 );

// Slow it down if your host rate-limits aggressive parallelism.
add_filter( 'loopia_unbatcher_concurrency', fn() => 4 );

Defaults: max_items = 25, concurrency = 8.

How it works

  1. WordPress's wp.apiFetch runs the JS middleware before each request.
  2. If the path matches /batch/v1, we short-circuit the network call.
  3. We iterate the requests[] body and re-issue each sub-request via wp.apiFetch again — that call hits the regular REST endpoints (which the host doesn't block) and inherits nonce, headers, and the rest of the middleware chain automatically.
  4. Sub-requests run with capped parallelism (default 8 at a time).
  5. We reassemble results into the { failed, responses: [] } shape the block editor expects and return.

The whole thing is ~150 lines of JS and runs entirely in the browser. No server-side proxy, no admin-ajax shim, no risk of leaking auth to the wrong origin.

Compatibility

  • WordPress 5.6+
  • PHP 7.2+
  • Works on single-site and multisite
  • Browser support follows wp.apiFetch (modern evergreen browsers)

Limitations

  • Increases request count — if your host charges per REST call, watch the dashboard.
  • Doesn't help if the host blocks individual REST endpoints too — only the batch aggregator.
  • Only runs on admin and customizer screens. Frontend block-editor rendering is not covered.

Contributing

Issues and PRs welcome. Keep the JS ES5-compatible for older WP installs.

License

GPL-2.0-or-later. See LICENSE.

Credits

Built by Nappe for the Loopia community and anyone else stuck behind a host that thinks /batch/v1 is dangerous.

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
v1.0.0 Jul 28, 2026 unbatcher.zip 0