Remove hidden scripts, styles, and APIs that slow down your site and increase security risks — with clean, tested code.
By default, WordPress loads 12+ unnecessary scripts and styles on every page — even if you don’t use them. This includes emoji support, embed handlers, XML-RPC, and the full REST API for guests.
This bloat:
This guide shows you how to safely remove it — with copy-paste code.
| Feature | Impact if Disabled | Safe to Remove? |
|---|---|---|
| Emoji Scripts | Saves 50KB + 1 request | ✅ Yes (unless you use emojis) |
| Embeds | Saves 30KB + 1 request | ✅ Yes (rarely used) |
| XML-RPC | Closes major security hole | ✅ Yes (obsolete since 2015) |
| REST API (for guests) | Prevents user data leaks | ✅ Yes (restrict, don’t disable fully) |
| jQuery Migrate | Saves 20KB if using modern jQuery | ✅ Yes (if no legacy plugins) |
Add this to your child theme’s functions.php or use the “Code Snippets” plugin:
// Disable Emoji
remove_action('wp_head', 'print_emoji_detection_script', 7);
remove_action('wp_print_styles', 'print_emoji_styles');
// Disable Embeds
wp_deregister_script('wp-embed');
// Disable XML-RPC
add_filter('xmlrpc_enabled', '__return_false');
// Restrict REST API for guests
add_filter('rest_authentication_errors', function($result) {
if (!empty($result)) return $result;
if (!is_user_logged_in()) {
return new WP_Error('rest_not_logged_in', 'Only authenticated users can access the REST API.', ['status' => 401]);
}
return $result;
});
// Hide WordPress version
remove_action('wp_head', 'wp_generator');
// Disable Dashicons on frontend
add_action('wp_enqueue_scripts', function() {
if (!is_admin()) wp_deregister_style('dashicons');
});
If you’re uncomfortable editing code or want a professional audit, our vetted Fiverr experts can:
Not if you don’t use them. Most sites never use emoji, embeds, or XML-RPC. If you rely on the REST API for a frontend app, only restrict it for non-logged-in users.
Yes — use the 'Perfmatters' or 'WP Disable' plugin. But adding a plugin just to disable features adds its own overhead. Code snippets are cleaner and faster.
Typically 30–50% fewer HTTP requests and 15–30% faster load times, especially on mobile. Every disabled script reduces render-blocking and bandwidth usage.
No — only restrict it for non-logged-in users. Many plugins (like WooCommerce) rely on it for frontend functionality.