Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. WordPress-Gatsby
  3. WPGraphQL Cors

WPGraphQL Cors

GPL-3.0PHP2.1.1

A WordPress plugin that enables WordPress authentication cookies to work with WP GraphQL by configuring CORS headers.

GitHubGitHub
125 stars20 forks0 contributors

What is WPGraphQL Cors?

WP GraphQL CORS is a WordPress plugin that configures CORS headers to make WordPress authentication work seamlessly with the WP GraphQL plugin. It solves the problem of accessing authenticated data, such as draft posts and private pages, through GraphQL requests by allowing WordPress cookies to be accepted. This enables developers to build frontend applications that interact securely with a WordPress backend.

Target Audience

WordPress developers building headless or decoupled frontends using WP GraphQL, who need to handle user authentication and access protected content via GraphQL APIs.

Value Proposition

Developers choose this plugin because it simplifies authentication setup by automatically handling CORS configurations, eliminating manual header adjustments. Its unique selling point is enabling WordPress's built-in cookie authentication to "just work" with WP GraphQL, reducing integration complexity.

Overview

Makes WP GraphQL's authetication "just work". It does this by customizing the CORS headers.

Use Cases

Best For

  • Enabling WordPress cookie authentication in headless WordPress setups
  • Accessing draft and private posts via WP GraphQL from a frontend application
  • Building frontend logout and login functionality with GraphQL mutations
  • Connecting multiple frontend domains to a single WordPress GraphQL backend
  • Securing GraphQL endpoints by filtering specific cookies
  • Simplifying CORS configuration for WP GraphQL without custom coding

Not Ideal For

  • Projects using JWT or OAuth tokens instead of cookie-based authentication with WP GraphQL
  • Developers who need to manage CORS headers at the server level without plugin dependencies
  • Teams building applications requiring real-time authentication or complex user sessions beyond basic login/logout
  • Static site generators that don't interact with a live WordPress backend for authenticated content

Pros & Cons

Pros

Seamless Cookie Integration

Automatically configures CORS headers to accept WordPress authentication cookies, enabling access to protected content like draft posts without manual setup, as highlighted in the README.

Multi-Domain Support

Allows multiple frontend domains to connect to a single WordPress backend, facilitating headless architectures with distributed frontends, as noted in the features list.

Security Customization

Offers cookie filtering options to enhance security by controlling which cookies are permitted in GraphQL requests, providing granular control as described.

Authentication Mutations

Adds login and logout mutations to WP GraphQL, simplifying the implementation of frontend authentication flows, with examples provided in the documentation.

Cons

WP GraphQL Dependency

Requires the WP GraphQL plugin to be installed and active, creating a dependency that might complicate updates or compatibility, as stated in the installation steps.

Limited Auth Scope

Focuses solely on cookie-based authentication, lacking built-in support for alternative methods like JWT, which are common in modern web apps and not addressed in the README.

Client-Side Setup Needed

Developers must configure their GraphQL clients (e.g., Apollo) to include credentials, adding an extra step and potential for misconfiguration, as mentioned in the installation guide.

Frequently Asked Questions

Quick Stats

Stars125
Forks20
Contributors0
Open Issues3
Last commit2 years ago
CreatedSince 2019

Tags

#api#headless-wordpress#authentication#graphql#wp-graphql#wordpress-plugin#cors#wordpress

Built With

W
WordPress
P
PHP

Included in

WordPress-Gatsby284
Auto-fetched 6 hours ago

Related Projects

WPGraphQL for WooCommerceWPGraphQL for WooCommerce

Add WooCommerce support and functionality to your WPGraphQL server

Stars703
Forks146
Last commit23 days ago
WPGraphQL for Advanced Custom FieldsWPGraphQL for Advanced Custom Fields

WPGraphQL for Advanced Custom Fields

Stars617
Forks111
Last commit2 years ago
WPGraphQL JWT AuthenticationWPGraphQL JWT Authentication

Authentication for WPGraphQL using JWT (JSON Web Tokens)

Stars363
Forks79
Last commit4 months ago
WPGraphQL GutenbergWPGraphQL Gutenberg

Query gutenberg blocks with wp-graphql

Stars306
Forks59
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub