Performance Snippet Beginner 4 min

Trim WordPress’s Front End: Six Things It Loads That You May Not Need

Emoji scripts, Dashicons, jQuery Migrate, oEmbed and a page head full of tags most sites never use. Six small snippets that take them off your pages, and how to check nothing broke.

TutorialBeginner10 minTested on WordPress 7.1Updated November 13, 2026

Open the source of almost any WordPress page and you’ll find things you didn’t add: an emoji script, a stylesheet for an icon font, a handful of <link> tags in the head. Each exists for a reason, but not necessarily for your site. In our WooCommerce speed guide we stopped a plugin loading its files everywhere. This post does the same for WordPress itself.

Change one thing at a time

Add one snippet, clear your cache, then click through your home page, a post, a form and (if you have one) the shop. If something looks wrong, you’ll know which change caused it.

1. The emoji script

WordPress loads a script on every page that checks whether the visitor’s device can show emoji, and swaps in images if it can’t. Every current browser and operating system shows emoji on its own. Removing the script doesn’t remove emoji: they still appear, using the visitor’s system font.

functions.phpPHP
add_action( 'init', function (): void {
	remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
	remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
	remove_action( 'wp_enqueue_scripts', 'wp_enqueue_emoji_styles' );
	remove_action( 'admin_enqueue_scripts', 'wp_enqueue_emoji_styles' );
	remove_action( 'wp_print_styles', 'print_emoji_styles' );
	remove_action( 'admin_print_styles', 'print_emoji_styles' );
	remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
	remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
	remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
} );

// Remove the classic editor's emoji plugin.
add_filter( 'tiny_mce_plugins', function ( array $plugins ): array {
	return array_diff( $plugins, [ 'wpemoji' ] );
} );

// Remove the DNS prefetch for the emoji CDN, whatever version it points to.
add_filter( 'wp_resource_hints', function ( array $urls, string $relation_type ): array {
	if ( 'dns-prefetch' !== $relation_type ) {
		return $urls;
	}
	return array_values( array_filter( $urls, function ( $url ): bool {
		$href = is_array( $url ) ? ( $url['href'] ?? '' ) : (string) $url;
		return ! str_contains( $href, 's.w.org/images/core/emoji' );
	} ) );
}, 10, 2 );
Tested on WordPress 7.1 · PHP 8.3Checked November 13, 2026

2. Dashicons for logged-out visitors

Dashicons is the icon font for wp-admin and the admin bar. Logged-out visitors don’t see the admin bar, but some themes still load the stylesheet for them. This removes it when the admin bar isn’t showing:

Snippet

Remove Dashicons When the Admin Bar Is Hidden

Stop WordPress from loading the Dashicons font stylesheet on the frontend for visitors who aren't logged in, since Dashicons is only needed for the admin bar.

PHPBeginner
View
Note

If your theme or a plugin uses Dashicons on the front end (look for icons that turn into empty squares), leave this one out.

3. jQuery Migrate

jQuery Migrate exists so very old jQuery code keeps working. Modern themes and plugins don’t need it. Remove it, then open your browser’s console on a few pages: if nothing new appears in red, you didn’t need it.

Snippet

Remove jQuery Migrate on the Frontend

Dequeue the jQuery Migrate script on the frontend for sites whose themes and plugins are compatible with modern jQuery, removing an unnecessary dependency.

PHPBeginner
View

4. Tags in the page head

WordPress adds several <link> tags to every page head: a shortlink, links to the previous and next posts, a REST API discovery link and a manifest for Windows Live Writer, a desktop blogging app that was discontinued years ago. None of them help visitors.

Snippet

Clean Up wp_head. Remove Unnecessary Link Tags

Remove the wlwmanifest link, shortlink, adjacent post links, REST API discovery link, and oEmbed discovery tags that WordPress adds to every page head by default.

PHPBeginner
View

5. oEmbed, if you don’t embed your own posts

oEmbed lets other sites embed previews of your posts, and loads a script so your posts can do the same with each other. If you don’t use that, switch it off. Embed blocks for YouTube, Vimeo and other services keep working. A bare video link typed into classic content no longer turns into a player, though, so use an Embed block for those. After adding it, save your permalinks once (Settings → Permalinks → Save Changes).

Snippet

Disable oEmbed Completely

Remove WordPress's oEmbed endpoint, front-end script, and discovery links to prevent your site from being embedded elsewhere and eliminate unnecessary oEmbed-related requests.

PHPBeginner
View

6. Heartbeat for visitors

The Heartbeat API keeps wp-admin up to date while you work: autosave, post locking and the “you’ve been logged out” warning. It doesn’t need to run for logged-out visitors, and it doesn’t need to run every 15 to 60 seconds on every admin screen. This turns it off on the front end and slows it down in wp-admin, without breaking any of those features:

Snippet

Control the Heartbeat API Safely

Turn off the Heartbeat API for logged-out visitors and slow it down in wp-admin, without breaking autosave, post locking or login expiry warnings.

PHPBeginner
View
You should now see

Open your home page logged out and look at the Network tab in your browser’s developer tools. You should see fewer requests than before, no wp-emoji-release.min.js, no dashicons.min.css and no jquery-migrate.min.js. Your pages should look exactly the same.

Something broke3 common fixes
  • A slider, menu or form stopped working. Put jQuery Migrate back first. It’s the change most likely to affect older code.
  • Icons became empty squares. Your theme uses Dashicons on the front end. Remove the Dashicons snippet.
  • Nothing changed. Clear your page cache and any CDN, and check that your caching or optimisation plugin isn’t combining files from an old copy.

Summary

Each of these is a small saving, but they apply to every page view. Remove the emoji script and the head tags first, since they’re safe on almost every site. Then try Dashicons, jQuery Migrate and oEmbed one at a time, checking your site after each. Finish by slowing Heartbeat down in wp-admin, which also helps when several people edit at once.

Was this helpful?

Written by Nahnu Plugins

We build and maintain WordPress plugins. Every guide is tested on a fresh WordPress site before it goes out, and checked again when WordPress updates.

More guides

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only