Headless Login Guard
Forces login for backend access in headless WordPress setups while allowing GraphQL/REST API endpoints and essential paths.
Use with caution
Headless Login Guard works, but test it on a staging site before relying on it in 2026. Is rated 5/5 and was last updated 4 months ago, and scores 56/100 on our health check.
- Small user base (<10 active installs)
- Very few reviews so far
- Needs PHP 8.1 or newer
How does it stack up?
Side-by-side on installs, updates, ratings & supportDaily downloads
Download spikes usually follow a new release — each site that auto-updates counts as a download.
Rankings
Where Headless Login Guard stands todayWordPress.org search rankings
Live position in the plugin search, top 100| Keyword | Position |
|---|---|
| GraphQL | #30 |
| headless | #36 |
| login | >100 |
| rest-api | >100 |
| security | >100 |
Rating breakdown
★★★★★★★★★★ 5 from 1 reviews
About Headless Login Guard
From the official readme · v1.1.0Description
A lightweight plugin that forces login for backend access in a headless WordPress setup. Keeps your WordPress dashboard private while allowing your front end (e.g. Astro, Next.js) to pull content via GraphQL/REST.
What it does
- Requires authentication for
/wp-admin/and other backend pages - Always allows the login page to avoid redirect loops
- Leaves key endpoints open for headless use:
/wp-json/(REST API)/graphql(WPGraphQL)/wp-admin/admin-ajax.php(AJAX)/wp-cron.php(cron)/robots.txt- WordPress core and common SEO sitemap XML paths
/wp-content/uploads/*(media)/favicon.ico/newrelic(New Relic monitoring)
- Logged-in users visiting the backend root get redirected to the dashboard
- Works with Bedrock layouts (handles root path vs
/wp/)
Use case
- WordPress is the content backend
- Public site is built with Astro/Next.js/etc
- Editors log in to WordPress. Visitors never see the backend
- Front end builds and live pages can still query GraphQL/REST without authentication
Customization
Developers can customize allowed endpoints using the force_login_allowed_patterns filter:
add_filter('force_login_allowed_patterns', function($patterns) {
$patterns[] = '#^/healthz$#'; // custom health check
$patterns[] = '#^/status$#'; // uptime checks
$patterns[] = '#^/wp-json/acf/v3/.*#'; // specific REST namespace
return $patterns;
});
Installation
- Upload the plugin files to the
/wp-content/plugins/headless-login-guarddirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- The plugin will automatically start protecting your backend – no configuration needed!
Changelog
Fixes sitemap access and request handling for subdirectory and Bedrock installations.
1.1.0
- Fixed: Allow WordPress core, Yoast-style, and nested sitemap XML paths
- Fixed: Match allowlisted endpoints correctly on subdirectory, Bedrock, and multisite installations
- Fixed: Preserve query strings without duplicating the site path in login redirect destinations
- Improved: Parse request paths separately from query strings
- Improved: Send no-cache headers before login redirects
- Improved: Added redirect, sitemap, query-string, and subdirectory integration tests
1.0.1
- Added: New Relic monitoring endpoint allowlist pattern (
/newrelic) to support APM monitoring - Added: WordPress.org plugin directory compatibility
- Added: Proper plugin structure with activation/deactivation hooks
- Added: Filter hook for customizing allowed patterns
- Improved: Code organization and documentation
1.0.0
- Initial release
- Restricts backend (
/wp-admin/) to authenticated users - Allows GraphQL and REST API endpoints for headless front-ends
- Basic whitelist of essential endpoints (cron, ajax, robots.txt, sitemaps, uploads)
For developers
Is this your plugin? Show off the numbers.
Add a live badge to your site, docs or GitHub README. It updates on its own — no account needed.
Best Headless Login Guard alternatives
All GraphQL plugins →FAQ
Headless Login Guard: quick answers
Straight answers, pulled from live WordPress.org data.
Source: WordPress.org
Is Headless Login Guard free?
Yes. Headless Login Guard is free to download and use from the official WordPress.org plugin directory.
Is Headless Login Guard safe to use in 2026?
Headless Login Guard works, but test it on a staging site before relying on it in 2026. Is rated 5/5 and was last updated 4 months ago, and scores 56/100 on our health check.
How many websites use Headless Login Guard?
Headless Login Guard is active on <10 WordPress websites and has been downloaded 441 times since it launched in May 2026. It was downloaded 82 times in the last 30 days.
Does Headless Login Guard work with WordPress 7.1?
Headless Login Guard is officially tested up to WordPress 7.0.9, while the latest release is 7.1.5. It may still work, but try it on a staging site first.
What PHP version does Headless Login Guard need?
Headless Login Guard requires PHP 8.1 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.
When was Headless Login Guard last updated?
The latest version, 1.1.0, was released on August 4, 2026 (4 months ago).
Who makes Headless Login Guard?
Headless Login Guard is developed and maintained by Andrew Wilkinson.
What are the best alternatives to Headless Login Guard?
The most popular alternatives to Headless Login Guard are WPGraphQL (30K+ installs), WPGraphQL for ACF (10K+ installs) and WPGraphQL Yoast SEO Addon (10K+ installs).
Powered by PageForge
One template and a spreadsheet. A real page for every search.
PageForge turns each row of a CSV into a WordPress page with its own title, URL, SEO fields and schema, built on the layout you already designed. Free on WordPress.org.
- CSV and XLSX, plus Google Sheets on Professional and Enterprise
- Its own title, URL, SEO fields and schema for every page
- Works with the block editor, Elementor, Divi and Avada
- Free on WordPress.org, no credit card
