How to Disable XML-RPC in WordPress Safely
WordPress XML-RPC allows external applications to communicate with your site through xmlrpc.php. Some site owners want to disable it because they do not use it or want to limit unwanted requests. But blocking it without checking your site’s integrations can cause another problem: a service that depends on XML-RPC may stop working.
Jetpack, for example, documents that XML-RPC is part of how it connects a self-hosted WordPress site to WordPress.com. Jetpack and XML-RPC
This guide explains what XML-RPC does, how to check whether your site needs it, what the different blocking methods actually control, and how to test changes safely. The right decision depends on your setup. Disabling XML-RPC is not a universal security fix.
What is WordPress XML-RPC?
XML-RPC is a protocol that lets an application communicate with a website. WordPress’ implementation supports compatibility with systems such as Blogger API, MetaWeblog, and MovableType, along with WordPress methods for posts, pages, comments, and other data. WordPress XML-RPC server reference
WordPress has enabled XML-RPC by default since version 3.5. The developer reference describes the xmlrpc_enabled filter, which can disable methods that require authentication. It also states that this filter does not control pingbacks or every custom endpoint that does not require authentication. WordPress XML-RPC server reference
That detail changes how you should interpret instructions that say “add this code to disable XML-RPC.” A filter may disable a set of methods without blocking every request to the endpoint. A firewall rule may block all requests. A plugin can have its own behavior. Understand the scope before you make the change.
Why would someone disable XML-RPC?
A site owner may want to reduce unnecessary exposure, remove a feature that no active tool uses, or respond to repeated unwanted traffic. Those are possible reasons to review XML-RPC access. But first confirm the site actually has a problem or does not need the feature.
Ask:
- Is Jetpack connected to this website?
- Does a mobile app, publishing service, or legacy plugin use XML-RPC?
- Is a security plugin already limiting or monitoring
xmlrpc.php? - Do logs show a specific problem, or is this change based on a generic checklist?
- Can you test the change on staging and undo it if an integration breaks?
Do not assume every request to xmlrpc.php is malicious. Some requests may be part of a legitimate connection. If you have a security alert, review its evidence and the affected method before making a broad block.
Check Jetpack and other integrations first
Jetpack says it uses XML-RPC to connect a self-hosted site to WordPress.com. It also says blocking xmlrpc.php completely can interrupt the Jetpack connection. Jetpack and XML-RPC
If your site uses Jetpack, do not block the endpoint globally until you have checked Jetpack’s guidance. Jetpack describes its authentication connection as token-based, but still uses XML-RPC for communication. Jetpack and XML-RPC
Other tools may use it too. Review mobile publishing apps, remote publishing systems, security tools, and any integration that communicates with WordPress from outside the site. If you are unsure, check the integration’s official documentation before changing access.
Record the current state before testing. If Jetpack or another service currently works, note that status and any existing warnings. This gives you something concrete to compare after a configuration change.
Disabling methods are not all the same
XML-RPC can be restricted at different layers:
- A WordPress filter can disable certain methods.
- A plugin can block or limit selected requests.
- A host or web application firewall can block traffic before WordPress receives it.
- A security service can rate-limit or allowlist particular requests.
These methods can have different side effects. WordPress says xmlrpc_enabled affects methods requiring authentication, but it does not switch off pingbacks or all custom unauthenticated endpoints. The developer reference identifies xmlrpc_methods and xmlrpc_element_limit as hooks for more granular control. WordPress XML-RPC reference
Choose the narrowest measure that addresses the actual problem. If the issue is excessive request volume, rate-limiting may be more appropriate than denying every request. If your site has no XML-RPC dependencies, a complete block might be an option, but test it first.
How to disable XML-RPC in WordPress
Option 1: Use a security plugin setting
Some security plugins offer XML-RPC controls. Read the plugin’s documentation to learn whether a setting blocks all requests, disables selected methods, or only changes certain authentication behavior.
Before changing it:
- Record the current setting.
- Check Jetpack and other dependencies.
- Change only the XML-RPC setting.
- Test the website and connected services.
- Restore the previous value if something important stops working.
Avoid installing multiple security plugins to manage the same endpoint. Overlapping rules can make it difficult to identify which plugin caused an error.
Option 2: Use a hosting or firewall rule
A host, CDN, or web application firewall may be able to limit requests to xmlrpc.php. This can block traffic before it reaches WordPress, but a broad rule may also block legitimate integrations.
If you use Jetpack, its troubleshooting documentation says a firewall or security rule that blocks its requests can cause connection issues. Its support guidance describes allowing required Jetpack requests where the host or security plugin supports an exception. Jetpack connection troubleshooting
Ask your host what a rule will block before you enable it. Use current provider instructions rather than copying an old IP list or server snippet from an unrelated tutorial.
Option 3: Use a WordPress filter
The WordPress developer reference gives this example for disabling XML-RPC methods that require authentication:
add_filter( 'xmlrpc_enabled', '__return_false' );
This does not necessarily block every XML-RPC behavior, including pingbacks or custom unauthenticated methods. WordPress XML-RPC server reference
If you use custom code, place it in a maintainable location such as a small site-specific plugin or a child theme that you control. Do not edit WordPress core files. Test on staging, keep a backup, and write down why you added the filter.
If the change causes an issue, remove the filter and test again. Avoid adding a snippet to production if you are not comfortable recovering the site through your host’s file manager or backup tools.
How to test XML-RPC after changing it
A browser request to xmlrpc.php is only a basic check. Jetpack says a working endpoint may show “XML-RPC server accepts POST requests only” in a browser. That tells you the endpoint responded to a browser request, but it does not prove every method is enabled or that your site’s security is configured correctly. Jetpack XML-RPC check
After a change, check:
- Your homepage and wp-admin still load.
- Jetpack reports a healthy connection if you use it.
- Any mobile or remote publishing tool still works.
- Your security logs show the behavior you intended.
- The endpoint returns the expected response.
- You know how to reverse the setting.
If Jetpack cannot reach XML-RPC, its support guide suggests checking the endpoint, host firewall, web application firewall, and security plugin rules. Jetpack connection troubleshooting
If the host blocks the request, repeatedly disconnecting and reconnecting Jetpack may not solve the underlying problem. Review the security rule with the hosting provider.
Safer alternatives to a blanket block
If you need XML-RPC for one service but want to limit unwanted traffic, consider:
- Rate-limiting requests rather than blocking all of them.
- Using a documented allowlist where your host supports one.
- Monitoring failed requests and investigating unusual patterns.
- Keeping WordPress, themes, and plugins updated.
- Using strong passwords and two-factor authentication for dashboard users.
- Restricting only the XML-RPC methods you do not need.
- Asking your host how it handles XML-RPC traffic.
No single XML-RPC setting replaces broader site security. It does not update vulnerable plugins, protect a weak administrator account, or provide a backup.
Common mistakes
Disabling it because a checklist says so
A generic hardening list may not know which integrations your site uses. Confirm dependencies before blocking the endpoint.
Assuming the filter blocks everything
The WordPress reference explains that xmlrpc_enabled does not cover pingbacks and all custom endpoints. Choose a method based on what you want to restrict. WordPress XML-RPC reference
Forgetting Jetpack
Jetpack states that its connection to WordPress.com uses XML-RPC. A global block can interrupt that connection. Jetpack documentation
Copying server rules without checking the host
Apache, NGINX, CDNs, and managed hosts do not all use the same configuration. A rule written for one setup may not work on another. Follow your provider’s current instructions.
Treating a browser response as a security audit
A simple browser response only shows that a request received a response. It does not confirm the behavior of every method, firewall rule, or integration.
Conclusion
XML-RPC is a compatibility interface that some WordPress tools still use. Disabling it may be appropriate when your site has no dependency on it, but a blanket block can interrupt Jetpack or another service.
Check integrations first, use the narrowest control that addresses your concern, and test the result. Base the decision on your own website’s requirements, not a universal security checklist.
Credible sources
Frequently Asked Questions
Is XML-RPC enabled by default in WordPress?
The WordPress developer reference says XML-RPC has been enabled by default since WordPress 3.5.0. A plugin, host rule, or custom filter may change its behavior.
Should every WordPress site disable XML-RPC?
No. Check whether Jetpack, a mobile app, or another integration relies on it. If no required tool uses XML-RPC, you can consider restricting it, but test the change.
Does xmlrpc_enabled disable pingbacks too?
The WordPress developer reference says the filter does not control pingbacks or all custom endpoints that do not require authentication.
Can disabling XML-RPC break Jetpack?
Yes. Jetpack says it uses XML-RPC to communicate between a self-hosted site and WordPress.com. Blocking the endpoint can interrupt that connection.
Does disabling XML-RPC guarantee better security?
No. It can reduce access to one interface when your site does not need it, but it does not replace updates, strong account security, backups, or monitoring.
