Expanded and up-to-date version of this topic: How to clean up WordPress header (remove RSS, emojis, shortlinks).
Open the source code of your website in your browser (Ctrl+U on Windows/Linux or Cmd+Option+U on macOS). Inspect the <head> element closely. In many WordPress installations, you will encounter dozens of lines of obscure markup. In 2026, most of these default elements represent obsolete baggage: legacy publishing manifests, individual comment feed declarations, emoji polyfills, and version tags inherited from era-defining software like Windows Live Writer.
Cleaning the document head is not an aesthetic exercise. Each redundant <link> element and unnecessary inline script inflates HTML byte weight, adds parsing overhead, and occasionally triggers avoidable external DNS handshakes. On high-traffic WooCommerce stores running numerous extensions, head clutter accumulates rapidly. A streamlined wp_head() output simplifies troubleshooting and minimizes version disclosure.
Primary technical documentation references: wp_head(), WordPress Developer Handbook, and web.dev LCP optimization guidance.
What WordPress outputs in the head section
A standard WordPress installation with a modern block theme typically prints several automated tags into the frontend head:
- RSS feeds for posts, categories, tags, and comments
- The
wlwmanifestfile link for Windows Live Writer - Really Simple Discovery links (
rsd_link) - The
meta name="generator"tag detailing the exact core version - Emoji detection scripts and inline CSS styles
- Shortlink reference tags (
?p=123) - Adjacent post navigation links (
rel="prev"andrel="next") - REST API and oEmbed discovery links
| Head element | Utility in 2026 | Removal risk |
|---|---|---|
| Comment feeds | Negligible | Very low |
Primary /feed/ endpoint | Moderate (readers, newsletters) | Moderate |
| wlwmanifest and RSD | Obsolete legacy | Very low |
| Core generator tag | None (information leak) | Very low |
| Emoji detection scripts | Handled natively by modern browsers | Very low |
| REST API discovery | High for headless / decoupled apps | High if external consumers require discovery |
| Shortlinks | Negligible | Very low |
This matrix provides an architectural roadmap: remove obsolete protocols and information leaks, while preserving endpoints that your business applications actively consume.
Why cleaning the WordPress head section matters
Performance gains from head cleanup
Prior to optimization, document headers frequently contain 10 to 20 superfluous tags and an external emoji script request routed to s.w.org. Eliminating these tags reduces total HTML size, accelerates DOM construction, and avoids unnecessary network requests. While desktop fiber users may notice small differences, the optimization delivers perceptible speed improvements on mobile cellular connections.
Security and version leakage prevention
The tag meta name="generator" content="WordPress x.y.z" reveals the exact version of your underlying engine. While obfuscation alone is not security, removing version signatures deprives automated vulnerability bots of easy profiling signals. Similar version strings appended to style and script URLs (style.css?ver=6.x) should be handled alongside generator tag removal.
Maintainability and clean staging diffs
A concise document head makes inspecting source changes significantly easier during staging deployments. When a newly installed extension injects third-party prefetch hints or tracking scripts, the addition stands out immediately in staging diff reviews.
1. Removing comment feeds and extra feed links
WordPress automatically constructs distinct RSS channels for every single post, category, and comment thread. Unless you operate a publication where readers subscribe to individual comment threads via desktop RSS aggregators, these links represent unneeded markup:
// Disable comment feed links
add_filter( 'feed_links_show_comments_feed', '__return_false' );
// Remove extra taxonomy and archive feeds
remove_action( 'wp_head', 'feed_links_extra', 3 );
// Only if your organization never uses RSS feeds:
// remove_action( 'wp_head', 'feed_links', 2 );Retain the primary feed_links hook if marketing newsletter tools or podcast syndication services depend on your central blog feed.
2. Removing wlwmanifest and RSD discovery tags
Windows Live Writer ceased active relevance years ago, yet WordPress still outputs manifest links. Similarly, Really Simple Discovery (RSD) supported remote editing workflows over XML-RPC that modern REST-based workflows do not require:
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'rsd_link' );Executing these removals eliminates:
<link rel="wlwmanifest" type="application/wlwmanifest+xml" ...><link rel="EditURI" type="application/rsd+xml" ...>
3. Disabling WordPress emoji scripts and styles
WordPress introduced a JavaScript library and inline CSS styles to convert text emoticons into raster images. All modern desktop and mobile operating systems render Unicode emojis natively. The default loader represents an unnecessary HTTP request and external DNS handshake to s.w.org:
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_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );For frontend optimization, removing the hooks attached to wp_head and wp_print_styles delivers the primary speed benefit.
4. Hiding the WordPress generator version tag
Hiding the core version from public markup is standard operational hardening:
remove_action( 'wp_head', 'wp_generator' );
add_filter( 'the_generator', '__return_empty_string' );The filter also empties generator tags inside syndicated feeds. While this does not replace regular security patching, it prevents automated reconnaissance crawlers from profiling your infrastructure.
5. Removing shortlinks and adjacent post links
Shortlink declarations (?p=123) and adjacent article relationship tags offer little benefit to modern search crawlers while adding unnecessary weight:
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
remove_action( 'template_redirect', 'wp_shortlink_header', 11 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );6. Managing REST API and oEmbed discovery links
// Only remove if external tools do not require automated REST discovery:
// remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
// remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
// remove_action( 'template_redirect', 'rest_output_link_header', 11 );Decoupled headless builds built on Astro or Next.js, as well as mobile applications, often rely on REST autodiscovery headers. On traditional marketing sites with no third-party integrations, removing these tags is entirely safe.
Creating a clean head must-use plugin
Rather than placing these instructions inside a theme’s functions.php where they risk being overwritten during updates, create a Must-Use plugin at wp-content/mu-plugins/wppoland-clean-head.php:
<?php
/**
* Plugin Name: WPPoland Clean Head
* Description: Eliminates obsolete legacy tags and scripts from wp_head.
* Author: wppoland.com
*/
function wppoland_cleanup_head(): void {
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'index_rel_link' );
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
add_filter( 'feed_links_show_comments_feed', '__return_false' );
add_filter( 'the_generator', '__return_empty_string' );
}
add_action( 'init', 'wppoland_cleanup_head' );Must-Use plugins execute automatically on every request without appearing in the standard plugin deactivation dashboard, guaranteeing architectural permanence.
How to test head cleanup in your browser
- Launch an incognito session and inspect the HTML: verify that generator tags, wlwmanifest links, and inline emoji scripts are absent.
- Open the Network panel in developer tools and confirm that
wp-emoji-release.min.jsis no longer requested. - Validate that your primary
/feed/endpoint returns valid XML if syndication is required. - Verify that drafting and publishing posts in Gutenberg functions normally without REST communication errors.
- Walk through the checkout funnel on WooCommerce stores to ensure no interactive states were affected.
Which head tags you should never remove
Head optimization targets legacy clutter, not functional requirements. Always preserve:
- Viewport declarations and character set metadata
- Canonical URL declarations and
hreflanginternational tags - Consent management and analytics loader tags
- Structured JSON-LD schema definitions
- Preload and preconnect directives for critical fonts and hero media
Pre-launch checklist for head cleanup
- Test changes on staging with all production plugins active.
- Verify the source code across homepage, single post, and checkout templates.
- Confirm primary RSS feeds operate in external reader software.
- Test Gutenberg block saving and REST responses.
- Clear edge caches (Cloudflare) and server-level page caches (Varnish / FastCGI).







