Skip to content

Clean WP Header #2

Description

@joeuttaro

You may want to add some / all of these to functions.php

add_action('wp_enqueue_scripts', 'clean_wordpress_header');
function clean_wordpress_header(){
    wp_deregister_script('comment-reply');

    remove_action('admin_print_styles',     'print_emoji_styles');
    remove_action('wp_head',                'print_emoji_detection_script', 7);
    remove_action('admin_print_scripts',    'print_emoji_detection_script');
    remove_action('wp_print_styles',        'print_emoji_styles');
    remove_filter('wp_mail',                'wp_staticize_emoji_for_email');
    remove_filter('the_content_feed',       'wp_staticize_emoji');
    remove_filter('comment_text_rss',       'wp_staticize_emoji');
    remove_action('wp_head',                'rest_output_link_wp_head');
    remove_action('wp_head',                'wp_oembed_add_discovery_links');
    remove_action('template_redirect',      'rest_output_link_header', 11, 0);
    remove_action('wp_head',                'rsd_link');
    remove_action('wp_head',                'wlwmanifest_link');
    remove_action('wp_head',                'wp_shortlink_wp_head');
    remove_action('wp_head',                'wp_generator');

    add_filter('emoji_svg_url', '__return_false');
    if(!is_front_page()){
        wp_dequeue_style('sb_instagram_styles');
        wp_dequeue_style('sb_instagram_icons');
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions