• Skip to main content
  • Skip to footer

HeyRobot

Experts in development, SEO and technical optimisation of WordPress and React solutions

  • EnglishEnglish
    • DanskDansk
    • EnglishEnglish
  • Services
    • React SEO
    • React + WordPress solutions
    • Pagespeed Optimisation
    • WordPress custom development
    • WordPress premium plugins
    • Custom website development
  • About
    • Privacy Policy
  • Geek blog
  • Contact

WordPress performance & optimisation functions

Below you can find a selection of functions that go in every project, that will instantly improve performance and pagespeed for a website without impacting usability and stability. Everything goes in your functions.php file

remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');

remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );

remove_action( 'wp_head', 'feed_links_extra', 3 ); // Removes extra feed links
remove_action( 'wp_head', 'feed_links', 2 ); // Removes default feed links
remove_action( 'wp_head', 'rsd_link' ); // Removes RDS links
remove_action( 'wp_head', 'wlwmanifest_link' ); // Removes default manifest
remove_action( 'wp_head', 'wp_generator' ); // Removes generator and version

// Removes ID from stylesheets making caching possible
function hey_remove_style_id($link) {
	return preg_replace('/ id=["|\']{1}.*-css["|\']{1} /', '', $link);
}
add_filter('style_loader_tag', 'hey_remove_style_id',9999);

Kim Frederiksen / 10/01/2019

Filed Under: Code snippets, Pagespeed optimisation, Wordpress

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Talk to us

You can always connect with us for an informal conversation or an objective look at your project

Call us at +45 30 27 95 56 or write us at info@heyrobot.com

Footer

Virtual runs

Information

  • Privacy Policy

Contact

HeyRobot
email: info@heyrobot.com

(C) 2019 HeyRobot