Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Attach to wp-login.php and xmlrpc.php

Additionally to using htaccess, you can disable the XML-RPC function by adding the following to your child theme’s functions.php:

# Set XML-RPC features to false
add_filter( 'xmlrpc_enabled', '__return_false' );
add_filter( 'pre_option_enable_xmlrpc', '__return_zero' );

Related Posts:

  1. Blocking access to wp-login via htaccess not working
  2. XMLRPC filtering through htaccess not working
  3. Basic Auth .htaccess on wp-login, but allow logout from woocommerce
  4. Improve wordpress security by hiding non public resources
  5. Does this .htaccess security setting really work?
  6. Change Login URL Without Plugin
  7. File and directory permissions
  8. adding rewrite rules in .htaccess
  9. Using “wordpress_logged_in” to restrict direct access to uploads folder in 2021
  10. WordPress URL/Folder ReWrite using Htaccess
  11. Which WordPress scripts need to be executable for a fresh installation?
  12. Block only external access to wp-cron.php on OpenLiteSpeed
  13. Restricting user login by IP address
  14. WordPress: Adding Security
  15. How do I test to ensure that my wp-config file is protected?
  16. WordPress not seeing .htaccess rules
  17. Rules in .htaccess only if the requested URL is /wp-admin
  18. Disable directory browsing of uploads folder
  19. Strange behaviour of is_user_logged_in() and get_current_user_id()
  20. Selectively Disabling PHP via .htaccess in Root Directory
  21. Azure WordPress deny access to xmlrpc
  22. Should I prevent access to .htaccess and wp-config.php files?
  23. Blocking wp-login in HTACCESS has also blocked password protected pages
  24. Using htaccess to prevent spam through wp-comments-post.php
  25. How can I create a private site that is inaccessible from the outside?
  26. Restrict Content for only Contributors via .htaccess
  27. Allowing access to certain WordPress created pages or posts with htaccess / htpasswd
  28. Security headers disappear on WordPress pages
  29. Why is this line of code Wrong in every WordPress .Htaccess security article?
  30. How to redirect all HTTP requests to HTTPS
  31. Best collection of code for your .htaccess file [closed]
  32. Best way to eliminate xmlrpc.php?
  33. Default .htaccess file for WordPress?
  34. Which one does WordPress prioritize when it comes to php.ini, wp-config and .htaccess?
  35. Security and .htaccess
  36. WordPress site hacked. Has .htaccess been hacked?
  37. htaccess problem after saving Settings
  38. Protecting direct access to PDF and ZIP unless user logged in (without plugin)
  39. Stop WordPress and Plugins from Overwriting .htaccess
  40. How to fake a WordPress login?
  41. htaccess disable WordPress rewrite rules for folder and its contents
  42. htaccess rewrite conflict with wordpress rules and ssl
  43. htaccess https redirect from www to non-www
  44. What does a security risk in a plugin look like?
  45. Brute force attack?
  46. Htaccess for Wordpess set on single subdomain
  47. Securing wp-admin folder – Purpose? Importance?
  48. .htaccess and 500 error, extra character added
  49. Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”
  50. Place static HTML files in path below WordPress page
  51. wp.getUsersBlogs XMLRPC Brute Force Attack/Vulnerability
  52. Static raw HTML page
  53. WordPress + Magento .htaccess ReWriteRule Issue (www vs. non-www)
  54. Plugin to edit htaccess file
  55. htaccess rewrite for author query string when WP is in subfolder
  56. Why “Settings->Permalinks” creates .htaccess file on nginx server?
  57. .htaccess for wordpress inside another wordpress install
  58. .htaccess file redirecting to parent directory
  59. Blog.php or how to display recent posts?
  60. Options for restricting access to wp-admin
  61. Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
  62. Globally force SSL on all pages
  63. Serve apache 404 for missing assets rather then wp 404 template WP_Rewrites
  64. Isolating WordPress to a subfolder
  65. Remove year and month in URL using .htaccess
  66. index.php not loading in main folder of wordpress
  67. Admin-Ajax.php, SSL, Non-SSL
  68. How to Block Access to Standard Login Flow and Comment Flow
  69. How disable SSL redirect for specific URL?
  70. How to secure WordPress XMLRPC?
  71. brute force attack even though it is limited by IP
  72. WordPress site displaying 404 for any page apart from index
  73. Which ways can be used to log in to WordPress?
  74. Why does the header set X-Robots-Tag apply to all pages?
  75. Permalinks not working on second wordpress installed in a subdirect
  76. How to avoid wordpress permalink rules to inherit in a sub-folder
  77. How to change “wp-admin” to something else without search-replacing the core?
  78. Error:406 not acceptable
  79. Unable to access WP admin
  80. .htaccess Rewrite URL WordPress
  81. Move wordpress to folder without changing urls
  82. Rewrite rule not working
  83. A plugin changes my .htaccess file and I can’t access httpd.conf as that’s a shared server
  84. Cant block wordpress readme files
  85. Change wp-content without changing the name of the folder
  86. 404/500 error on /wp-json
  87. WordPress keeps deleting .htaccess file
  88. Correct htaccess to display page while also passing in GET parameters
  89. What is the role of .htaccess file in WordPress?
  90. How to prevent bot or someone to modify any file automatically?
  91. How to disable XML-RPC from Linux command-line in a total way?
  92. Using WordPress only for the backend, and using AngularJS as a frontend
  93. Temporary .htaccess blocking is disabling WP Crons from running?
  94. Block access to wp-admin
  95. How to restrict access to wp-content, wp-includes and all sub-folders
  96. Two domains on one WordPress Installation
  97. .htaccess redirects disappeared after re-saving permalinks
  98. Protect Upload Folder Files With Ampersand Problem
  99. How have I misconfigured basic auth for my wordpress site?
  100. Remove File Extension for Page Outside of WordPress
Categories htaccess Tags .htaccess, hacks, security, wp-login-form, xml-rpc
How do I save custom options on the options page ‘Reading’?
How to get a Custom 500 Error Page to show?

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress