Skip to content

Instantly share code, notes, and snippets.

@itcomindo
Created June 10, 2022 23:22
Show Gist options
  • Save itcomindo/822ede091c6099bf27c95f89ca9f64eb to your computer and use it in GitHub Desktop.
Save itcomindo/822ede091c6099bf27c95f89ca9f64eb to your computer and use it in GitHub Desktop.
Cleanup Head
<?php
/*
* Source: https://gist.github.com/HechtMediaArts/aceadf06b5e4431dc33d
*/
//emoji aus dem header entfernen
function disable_emoji_dequeue_script() {
wp_dequeue_script( 'emoji' );
}
add_action( 'wp_print_scripts', 'disable_emoji_dequeue_script', 100 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
// Header Links entfernen
add_action('init', 'remheadlink');
function remheadlink()
{
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
remove_action('wp_head', 'index_rel_link');
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'feed_links', 2);
remove_action('wp_head', 'feed_links_extra', 3);
remove_action('wp_head', 'parent_post_rel_link', 10, 0);
remove_action('wp_head', 'start_post_rel_link', 10, 0);
remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
remove_action('wp_head', 'wp_shortlink_header', 10, 0);
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment