Advertisement
niammuddin

hapus header tidak penting wordpress

Jul 27th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.87 KB | None | 0 0
  1. <?php
  2. function apus_js() {
  3.     if (!is_admin()) {
  4.         wp_deregister_script('wp-embed');
  5.         wp_deregister_script('jquery');  // Bonus: remove jquery too if it's not required
  6.     }
  7. }
  8. add_action('init', 'apus_js');
  9.  
  10. // hapus WP_EMOJI
  11. remove_action('wp_head', 'print_emoji_detection_script', 7);
  12. remove_action('wp_print_styles', 'print_emoji_styles');
  13. remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
  14. remove_action( 'admin_print_styles', 'print_emoji_styles' );
  15. add_filter( 'emoji_svg_url', '__return_false' );
  16.  
  17. // Disable REST API link tag
  18. remove_action('wp_head', 'rest_output_link_wp_head', 10);
  19.  
  20. // Disable oEmbed Discovery Links
  21. remove_action('wp_head', 'wp_oembed_add_discovery_links', 10);
  22.  
  23. // Disable REST API link in HTTP headers
  24. remove_action('template_redirect', 'rest_output_link_header', 11, 0);
  25.  
  26. // remove head attribut
  27. function itsme_disable_feed() {
  28. wp_die( __( 'No feed available, please visit the <a href="'. esc_url( home_url( '/' ) ) .'">homepage</a>!' ) );}
  29. add_action('do_feed', 'itsme_disable_feed', 1);
  30. add_action('do_feed_rdf', 'itsme_disable_feed', 1);
  31. add_action('do_feed_rss', 'itsme_disable_feed', 1);
  32. add_action('do_feed_rss2', 'itsme_disable_feed', 1);
  33. add_action('do_feed_atom', 'itsme_disable_feed', 1);
  34. add_action('do_feed_rss2_comments', 'itsme_disable_feed', 1);
  35. add_action('do_feed_atom_comments', 'itsme_disable_feed', 1);
  36. remove_action( 'wp_head', 'feed_links_extra', 3 );
  37. remove_action( 'wp_head', 'feed_links', 2 );
  38. remove_action('wp_head', 'rsd_link');
  39. remove_action('wp_head', 'wp_generator');
  40. remove_action('wp_head', 'wlwmanifest_link');
  41. remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
  42. add_filter( 'start_post_rel_link', 'remove_code');
  43. add_filter( 'previous_post_rel_link', 'remove_code' );
  44. add_filter( 'next_post_rel_link', 'remove_code' );
  45. function remove_code( $data ) {
  46. return false;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement