APACHE 35
Htaccess security By micha on 9th September 2019 11:46:31 AM
  1. ## functions.php
  2.  
  3. // DISABLE REST ENDPOINTS
  4. function remove_default_endpoints( $endpoints ) {
  5.   return array( );
  6. }
  7. add_filter( 'rest_endpoints', 'remove_default_endpoints' );
  8.  
  9. // REDIRECT AUTHOR TESTS
  10. function author_page_redirect() {
  11.   if ( is_author() ) {
  12.     wp_redirect( home_url() );
  13.   }
  14. }
  15. add_action( 'template_redirect', 'author_page_redirect' );
  16.  
  17. // REMOVE XMLRPC
  18. add_filter( 'xmlrpc_enabled', '__return_false' );
  19.  
  20. function remove_xmlrpc_pingback( $headers ) {
  21.   unset( $headers['X-Pingback'] );
  22.   return $headers;
  23. }
  24. add_filter( 'wp_headers', 'remove_xmlrpc_pingback' );
  25.  
  26.  
  27. ## wp-config:
  28.  
  29. define('WP_HTTP_BLOCK_EXTERNAL', true);
  30. define('WP_ACCESSIBLE_HOSTS', 'downloads.wordpress.org,wordpress.org');

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.