Block xmlrpc.php on Pressidium
Pressidium Managed WordPress Hosting allows XML-RPC by default. If your site does not need it, you can block xmlrpc.php using .htaccess or ask Pressidium Support to apply the block for a specific site or domain.
Both methods return 403 Forbidden for xmlrpc.php and work for Pressidium-hosted sites behind a reverse proxy. A block scoped to this file leaves the WordPress REST API (/wp-json/) and wp-admin login unchanged.
Before you block XML-RPC
XML-RPC lets external applications communicate with WordPress. Uses include:
- Jetpack connecting to WordPress.com
- WordPress and Jetpack mobile app connections that use XML-RPC
- Remote publishing tools that use XML-RPC
You can block XML-RPC when your site no longer needs these connections. This reduces access to an endpoint commonly targeted by automated abuse. It does not replace DDoS protection or WordPress Login Protection.
Before making a change, record the XML-RPC and REST status codes using the commands in Confirm the block below. Check that you can sign in to wp-admin. This gives you a baseline to compare after the change.
Block XML-RPC using .htaccess
You can apply the block yourself if you have access to edit your site’s files. If you need help, use the Support option below.
- Locate
xmlrpc.phpin your WordPress installation and the.htaccessfile in the same directory. If your file client hides dotfiles, enable its option to show hidden files. - Save a copy of the existing
.htaccessfile before editing it. If there is no file, create a plain-text file named.htaccessin that directory. - Add the following block on its own, outside any existing configuration blocks and outside the
# BEGIN WordPressand# END WordPressmarkers. Preserve the existing rules.
<Files xmlrpc.php>
Require all denied
</Files>
- Save the file and follow Confirm the block below.
For a reverse-proxy site, edit .htaccess on the Pressidium-hosted WordPress origin and verify the result through the public hostname visitors use.
This rule matches the file name. If you need to limit the block to one hostname that shares a WordPress installation with other hostnames, ask Support to apply a domain-specific block.
To undo your change, remove only the block you added. If an editing error prevents the site from loading, restore the saved file and contact Support.
Ask Support to apply the block
Support can return 403 for /xmlrpc.php on a specific site or domain while leaving REST and wp-admin unchanged. This option also works for reverse-proxy sites.
- Open a support request.
- Ask for a block on
/xmlrpc.phpthat returns 403 Forbidden. Specify whether it should apply to the site or only to particular domains. - Include your team name, website name, and each hostname to block, such as
www.example.com. - Confirm whether Jetpack, a mobile app, or a remote publishing tool still needs XML-RPC.
- For a reverse-proxy setup, include both the public hostname and the Pressidium origin hostname, plus any path prefix used to reach WordPress.
Wait for Support to confirm the change, then verify it through the public hostname. To reverse a Support-applied block, reply to the ticket and ask Support to remove it.
Confirm the block
Run these commands in a terminal with curl, replacing example.com with the hostname you changed. If WordPress is served under a subdirectory, include that prefix in each URL. For a reverse-proxy site, use the public URLs.
curl --silent --show-error --output /dev/null --write-out '%{http_code}\n' 'https://example.com/xmlrpc.php'
curl --silent --show-error --output /dev/null --write-out '%{http_code}\n' 'https://example.com/wp-json/'
Each command makes a GET request and prints its HTTP status code:
- XML-RPC: Expect 403 after applying either block.
- REST API: Expect 200 for a normally accessible REST index, both before and after the change. If REST was already restricted, compare with the baseline and report the existing restriction to Support; this block should not change it.
These commands do not follow redirects. If you receive a 301 or 302, check the destination and repeat the check using the intended final HTTPS URL. Confirm that its hostname is included in the block.
Finally, open your site’s /wp-admin/ URL and confirm that you can still sign in. Check that your normal site pages still load. Repeat the checks for each hostname you intended to block.
Troubleshooting
XML-RPC does not return 403
Check that you tested the intended hostname and WordPress path. For the self-service method, check the rule and the location of .htaccess. For a Support-applied block, compare the tested hostname with the ticket and confirm that Support has completed the change.
If the result still differs, contact Support with the details below.
REST or wp-admin stops working
Compare REST with the baseline and check whether other changes were made at the same time. If you edited .htaccess, undo only your added block and retest. For a Support-applied block, reply to the ticket with the failing URLs and responses.
Jetpack or a mobile app stops connecting
The connection may still need XML-RPC. Remove your added .htaccess block, or ask Support to remove their block, then retry the connection before deciding whether to block XML-RPC again.
Get help from Support
Open a support request or reply to your existing ticket. Include:
- Your team and website name
- The public hostname and, for a reverse proxy, the origin hostname and any path prefix
- Whether you used
.htaccessor requested a Support-applied block - The tested URLs, time of the checks, and status codes for XML-RPC and REST before and after the change
- Whether wp-admin login works and whether Jetpack, a mobile app, or remote publishing is affected
Where to go next
- DDoS Protection (Network Layer) explains how network-layer protection differs from protection for WordPress endpoints.
- WordPress Login Protection covers protection against login-page abuse.
Was this article helpful?