Secure Guide to Publishing WordPress Posts Remotely
Prefer Secure Transport
Use the WordPress REST API instead of XML-RPC (which is riskier), and enforce HTTPS to encrypt data in transit and avoid plaintext leaks.
Strengthen Authentication
Enable OAuth 1.0a or Application Passwords authentication and disable simple HTTP basic auth; pair them with two-factor authentication (2FA) and reCAPTCHA verification to stop brute-force attacks.
1. First choice: OAuth 1.0a authentication (most secure)
- Use cases: Third-party tools / custom programs calling the REST API remotely
- How it works: Signatures are generated from the “Consumer Key” and “Consumer Secret”; every request includes a timestamp and nonce, so keys are never transmitted in plaintext.
- Advantages: No need to expose account passwords; supports fine-grained permission control (e.g., allowing only “Publish posts”), and even intercepted requests can't reuse the signature.
- Implementation:
- Install a plugin (such as WP OAuth Server) to enable the OAuth service on the WordPress side;
- Third-party tools (such as Python scripts or client programs) generate signed requests using an OAuth library (such as oauth1-requests).
2. Second choice: Application Passwords (native WordPress support)
- Use cases: Lightweight remote publishing (e.g., script automation, simple tool integrations)
- How it works: Generates an independent “Application Password” (not your login password) tied to a username, which can be revoked individually.
- Advantages: Native support (WordPress 5.6+), no extra plugins needed, avoids leaking the main password — if compromised, just revoke that application password.
- Notes:
- HTTPS must be enforced (otherwise passwords travel in plaintext);
- Store application passwords carefully and generate different ones per use case (e.g., separate passwords for “script publishing” and “Tool A”).
Restrict Access Permissions
Assign the remote-publishing account the least privilege needed (e.g., “Author”), and set an IP whitelist via .htaccess or Cloudflare so only trusted IPs can access the interface.
Disable Redundant Features
When XML-RPC isn't needed, disable it with a plugin or code (add add_filter(‘xmlrpc_enabled’, ‘__return_false’); to functions.php), and turn off the system.multicall method to prevent batch attacks.
Security Configuration and Monitoring
Use security plugins like Wordfence for protection, check server logs regularly, and use Fail2Ban to auto-ban malicious IPs; account passwords should include letters, numbers and special characters (length ≥ 12), and never use the default admin username.