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. Why is this line of code Wrong in every WordPress .Htaccess security article?
  29. When accessing a wordpress blog, I want to force http when accessing wordpress via xmlrpc otherwise force https
  30. WordPress site hacked. Has .htaccess been hacked?
  31. Brute force attack?
  32. .htaccess and 500 error, extra character added
  33. Place static HTML files in path below WordPress page
  34. htaccess rewrite for author query string when WP is in subfolder
  35. Why “Settings->Permalinks” creates .htaccess file on nginx server?
  36. .htaccess for wordpress inside another wordpress install
  37. Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
  38. Globally force SSL on all pages
  39. Correct htaccess to display page while also passing in GET parameters
  40. Block access to wp-admin
  41. How have I misconfigured basic auth for my wordpress site?
  42. Remove File Extension for Page Outside of WordPress
  43. WordPress trims off the forward slash when import
  44. WordPress best solution shared theme for consumers and businesses (two url’s one instaltion)
  45. Redirect main domain to subdirectory
  46. Remove special characters in a URL
  47. different child theme for subdomain
  48. How do I edit the htaccess file to optimize my website?
  49. Is it possible to post with Word 2007 via XML-RPC and limit categories by user?
  50. Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?
  51. FORCE_SSL_ADMIN not working
  52. Site searches by Python for non-existent assets
  53. WordPress On subfolder
  54. Override htacces rule only for specific directory
  55. How To Allow Only Specific User Agent To Access a URL?
  56. How to ignore folder in site root while accessing a URL
  57. How can I enable keep alive (Not accessing to Apache)
  58. HTTP sitewide, except for: wp-admin, and 2 custom directories
  59. WordPress installed in root, need second in subdirectory with different domain
  60. htaccess has broken my site
  61. TimThumb & htaccess : clean url
  62. Only Allow Front End Access
  63. .htacess rewrite condition: page to seconddomain/page
  64. .htaccess RewriteCond excluding directories does not work when there is an .htaccess or php.ini in subdirectory
  65. WordPress .htaccess file gives issues with subdirectory
  66. W3 Total Cache CSS & JS files GZip issues [closed]
  67. WP Super Cache unable to locate cache file for only the homepage
  68. Cannot login to WordPress site after changing .htaccess for security purposes
  69. WordPress permalink, stop redirection
  70. add_rewrite_rule to remove /category/ from permalink
  71. Is wp_login_form secure on a non secure page?
  72. .htaccess Non-‘www’ to ‘www’ Subdomain Redirection Only Works for Homepage
  73. Non WordPress Folder in a WordPress Site
  74. Htaccess rewrite based on query string, not working [closed]
  75. Redirect all subdomains to root domain
  76. Where is the php file, that does the checks for login information?
  77. Change root directory
  78. How to execute WordPress as though it is in the root folder while it is installed in a subdirectory?
  79. Htaccess maintenance page rules that actually work with WordPress?
  80. How to allow only vpn access to dashboard on Bitnami WordPress by IP address restricting
  81. After limiting the access to my wp-login.php by IP through .htaccess, all my password-protected posts stopped working. What’s the best solution now?
  82. htaccess redirect to path
  83. Non-wordpress subdomain on Multisite Installation
  84. Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN
  85. Rewrite rules and maintain URL
  86. Subfolder renaming
  87. Targeting .htaccess file with file_put_contents
  88. Redirect Loop in Regex Moving to HTTPS
  89. .htaccess file changes disappear
  90. WordPress login bug. Need an emergency solution
  91. .htaccess and virtual host configuration for WP in its own directory
  92. Hide wp-login.php but not the widget
  93. 403 forbidden due to .htaccess?
  94. How to rename the WordPress wp-login.php running on IIS6?
  95. Where is the htaccess in wordpress.com hosting?
  96. Debug errors for “Destination directory for file streaming does not exist or is not writable”
  97. How To Add CSP frame ancestors in WordPress Website? [closed]
  98. How do I modify each instance of setcookie?
  99. How to I serve the static HTML file at the root directory in a wordpress site?
  100. What’s the point of the default .htaccess?
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
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 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