{"id":688,"date":"2020-06-04T13:28:08","date_gmt":"2020-06-04T05:28:08","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=688"},"modified":"2026-01-12T12:55:24","modified_gmt":"2026-01-12T04:55:24","slug":"how-to-disable-xml-rpc-in-wordpress","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/how-to-disable-xml-rpc-in-wordpress","title":{"rendered":"How to Disable XML-RPC in WordPress"},"content":{"rendered":"<h4><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/www.lcinternet.es\/wp-content\/uploads\/2017\/02\/wordpress-xml-rpc-640x2501.png\" alt=\"How to Disable XML-RPC in WordPress?\" width=\"640\" height=\"250\" \/><\/h4>\n<h4><strong>How to Disable XML-RPC in WordPress?<\/strong><\/h4>\n<p>All you have to do is paste the following code in a site-specific plugin:<\/p>\n<p><strong>add_filter<\/strong>(\u2018<strong>xmlrpc_enabled\u2019, \u2018__return_false<\/strong>\u2018);<\/p>\n<p>Alternatively, you can just install the plugin called\u00a0<a href=\"https:\/\/wordpress.org\/plugins\/disable-xml-rpc\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Disable XML-RPC<\/a>. All you have to do is activate it. It does the exact same thing as the code above.<\/p>\n<p><strong>H<\/strong><strong>ow to Disable WordPress XML-RPC with .htaccess<\/strong><\/p>\n<p>While the above solution is sufficient for many, it can still be resource intensive for sites that are getting attacked.<\/p>\n<p>In those cases, you may want to disable all xmlrpc.php requests from the .htaccess file before the request is even passed onto WordPress.<\/p>\n<p>Simply paste the following code in your .htaccess file:<\/p>\n<p># Block WordPress xmlrpc.php requests<\/p>\n<p><strong>&lt;Files xmlrpc.php&gt;<br \/>\norder deny,allow<br \/>\ndeny from all<br \/>\n&lt;\/Files&gt;<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Disable XML-RPC in WordPress? All you have to do is paste the following code in a site-specific plugin: add_filter(\u2018xmlrpc_enabled\u2019, \u2018__return_false\u2018); Alternatively, you can just install the plugin called\u00a0Disable XML-RPC. All you have to do is activate it. It does the exact same thing as the code above. How to Disable WordPress XML-RPC with .htaccess While the above solution&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[28],"kbtag":[1134,1616],"class_list":["post-688","kb","type-kb","status-publish","hentry","kbtopic-wordpress","kbtag-wordpress","kbtag-xml-rpc"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=688"}],"version-history":[{"count":4,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/688\/revisions"}],"predecessor-version":[{"id":5980,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/688\/revisions\/5980"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=688"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=688"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}