RealComposer

WordPress Safe & Unsafe Practices

Direct Answer

WordPress REST API credentials (application passwords, JWT plugins, or OAuth tokens) belong on a server or edge proxy, not in static or low-code frontends. Use _fields or custom mapping to avoid shipping full post content to clients.

Credentials & Where They Belong

Server only
Application password

Basic auth credential for REST access; never embed in public sites.

Client safe
Cookie or nonce (logged-in user)

Short-lived session scoped to the current WordPress user only.

Safe Practices

  • Proxy wp-json through an edge pipeline

    Clients call your edge URL with a client token while the Worker holds the application password.

  • Request slim field sets

    Use _fields=id,title,excerpt or output mapping so mobile clients skip rendered HTML blobs.

Unsafe Practices

  • Embedding application passwords in theme JavaScript

    Anyone viewing source can publish or delete content with your credentials.

  • Exposing unauthenticated wp-json on public hosts

    User enumeration and revision leaks are common on misconfigured sites.

The RealComposer Pattern

Store WP_APPLICATION_PASSWORD in the vault, call /wp-json/wp/v2 with Basic auth from the Worker, and map only the fields your headless UI renders.

START BUILDING FREE

Frequently Asked Questions

Q:Should WordPress apiKey in wp-config be treated as secret?

The public site uses it for some embeds, but REST application passwords and JWT secrets are server-only credentials.

WordPress Recipes

Related Concepts