एक fresh WordPress install करो। Source code खोलो। वहाँ आपको मिलेंगे — emoji detection scripts, oEmbed JavaScript, generator meta tag, RSD link, WLW manifest link, shortlink tags, REST API links, और बहुत कुछ।
इनमें से किसी की भी आपके typical blog या website को ज़रूरत नहीं है।
2025 की Melapress Security Survey यह बताती है कि 96% WordPress users ने कम से कम एक security incident face किया है — और जिन sites पर unnecessary features disabled थे, उन्हें significantly कम incidents हुए। Performance पर भी सीधा effect है — हर extra script 15-80KB add करता है और browser parsing time बढ़ाता है।
आज हम वो सब code एक जगह देखेंगे — safely, logically, बिना site तोड़े। और हर fix के साथ clearly बताएंगे कि कब नहीं करना है।
{getToc} $title={Table of Contents} $count={true} $width={full}
Code कहाँ Add करें — WPCode vs functions.php
इस article के सभी code snippets दो जगहों पर add किए जा सकते हैं:
- WPCode Plugin (Recommended) — Free plugin जो code को functions.php से अलग रखता है। Theme update होने पर code safe रहता है। Individual snippets enable/disable कर सकते हो।
- Child Theme का functions.php — Direct method, लेकिन child theme ज़रूरी है। Parent theme update से code safe रहे।
functions.php में कभी भी directly parent theme में code add मत करो। Theme update होने पर सब delete हो जाएगा। हमेशा child theme या WPCode use करो।
Fix #1 — WordPress Emojis Completely Disable करो
WordPress 4.2 में emoji support add हुई — पुराने browsers के लिए text emojis को images में convert करने के लिए। 2026 में हर browser natively emojis support करता है। यह script completely useless है।
यह क्या load करता है: emoji detection JavaScript (~15KB), emoji CSS, और RSS feed में emoji image replacements।
// WordPress Emojis completely disable करो
function rs_disable_emojis() {
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' );
add_filter( 'emoji_svg_url', '__return_false' );
add_filter( 'tiny_mce_plugins', 'rs_disable_emojis_tinymce' );
}
function rs_disable_emojis_tinymce( $plugins ) {
return is_array( $plugins ) ? array_diff( $plugins, array( 'wpemoji' ) ) : array();
}
add_action( 'init', 'rs_disable_emojis' );
कब नहीं करें: अगर आपकी site explicitly emoji images use करती है किसी feature के लिए। Normal content पर emojis browser से आते हैं — यह code उन्हें affect नहीं करता।
Fix #2 — oEmbed और WordPress Embeds Disable करो
WordPress oEmbed आपको URLs paste करके automatically YouTube, Twitter, Instagram embeds create करने देता है। अच्छा feature है — लेकिन इसके साथ एक extra JavaScript file load होती है और head में oembed discovery links आते हैं।
अगर आप manually iframes use करते हो embeds के लिए — यह completely disable कर सकते हो।
// WordPress oEmbed और Embeds disable करो
function rs_disable_embeds() {
// oEmbed discovery links head से remove करो
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
// oEmbed JavaScript remove करो
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
// oEmbed filter remove करो
remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );
// REST API से oEmbed route remove करो
remove_action( 'rest_api_init', 'wp_oembed_register_route' );
// wp-embed.min.js dequeue करो
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_script( 'wp-embed' );
});
}
add_action( 'init', 'rs_disable_embeds' );
कब नहीं करें: अगर आप post content में YouTube या other platform के URLs paste करके automatic embeds use करते हो। उस case में यह feature ज़रूरी है।
Fix #3 — XML-RPC Disable करो — Security और Performance दोनों के लिए
XML-RPC WordPress का legacy remote publishing API है। इसे 2003 में बनाया था। आज इसे WordPress mobile app, Jetpack, और कुछ third-party tools use करते हैं।
लेकिन xmlrpc.php brute-force attacks का सबसे common entry point है। एक single XML-RPC request में attackers 500+ login attempts try कर सकते हैं। अगर आप mobile app या Jetpack use नहीं करते — यह immediately disable करो।
// Method 1: PHP से disable करो (WPCode में add करो)
add_filter( 'xmlrpc_enabled', '__return_false' );
// Head से RSD link remove करो (xmlrpc.php discovery link)
remove_action( 'wp_head', 'rsd_link' );
// Head से WLW manifest link remove करो
remove_action( 'wp_head', 'wlwmanifest_link' );
// Method 2: .htaccess से block करो (Apache servers पर)
// यह more complete protection है
// .htaccess में add करो WordPress rules के ऊपर:
// <Files xmlrpc.php>
// Order Allow,Deny
// Deny from all
// </Files>
// Method 3: Nginx पर (server config में)
// location = /xmlrpc.php {
// deny all;
// return 403;
// }
कब नहीं करें: अगर WordPress mobile app use करते हो, Jetpack features use करते हो, या कोई third-party service जो specifically XML-RPC पर depend करती हो।
Fix #4 — REST API Links Head से Remove करो
WordPress 4.4 के बाद WordPress का REST API head में discovery links add करता है। यह legitimate feature है — third-party apps और block editor इसे use करते हैं। लेकिन frontend पर public users को यह links दिखाने की ज़रूरत नहीं है।
REST API completely disable करना dangerous है — Block Editor इस पर depend करता है। लेकिन head से discovery links remove करना safe है।
// REST API head links remove करो (API itself disable नहीं होगा)
remove_action( 'wp_head', 'rest_output_link_wp_head' );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'template_redirect', 'rest_output_link_header', 11 );
// Unauthenticated REST API access restrict करो
// (API काम करेगा लेकिन login के बिना sensitive data नहीं मिलेगा)
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',
'REST API requires authentication.',
array( 'status' => 401 )
);
}
return $result;
});
Important Note: REST API को completely block मत करो — Gutenberg Block Editor, WooCommerce, और बहुत plugins इस पर depend करते हैं।
Fix #5 — Generator Meta Tag और WordPress Version Hide करो
WordPress by default head में यह tag add करता है:
<meta name="generator" content="WordPress 6.8" />
यह attackers को exactly बताता है कि आप कौन सा WordPress version use कर रहे हो। अगर उस version में कोई known vulnerability है — targeted attack हो सकता है।
// Generator meta tag remove करो
remove_action( 'wp_head', 'wp_generator' );
// WordPress version को CSS और JS files से भी hide करो
function rs_remove_wp_version_strings( $src ) {
global $wp_version;
parse_str( parse_url( $src, PHP_URL_QUERY ), $query );
if ( ! empty( $query['ver'] ) && $query['ver'] === $wp_version ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
}
add_filter( 'script_loader_src', 'rs_remove_wp_version_strings' );
add_filter( 'style_loader_src', 'rs_remove_wp_version_strings' );
Fix #6 — Shortlink, Feed Links, और Unnecessary Head Tags Remove करो
WordPress head section में कई legacy tags होते हैं जो modern sites पर useless हैं। एक साथ हटाओ:
// Shortlink remove करो (WordPress automatically short URL generate करता है) remove_action( 'wp_head', 'wp_shortlink_wp_head' ); remove_action( 'template_redirect', 'wp_shortlink_header', 11 ); // Feed links remove करो (अगर आपके blog के RSS feeds publicly needed नहीं हैं) // Note: अगर users RSS subscribe करते हैं तो यह मत हटाओ remove_action( 'wp_head', 'feed_links', 2 ); remove_action( 'wp_head', 'feed_links_extra', 3 ); // Adjacent posts links remove करो (SEO के लिए कभी-कभी confusing होते हैं) remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' ); // DNS prefetch remove करो remove_action( 'wp_head', 'wp_resource_hints', 2 );
Fix #7 — Dashicons Frontend पर Disable करो
Dashicons WordPress admin का icon system है। Problem यह है — यह frontend पर logged-out users के लिए भी load होता है by default। यह करीब 30KB+ add करता है — बिना किसी reason के।
// Dashicons frontend पर logged-out users के लिए disable करो
add_action( 'wp_enqueue_scripts', function() {
if ( ! is_user_logged_in() ) {
wp_deregister_style( 'dashicons' );
}
}, 99 );
कब नहीं करें: अगर आपकी theme या कोई plugin frontend पर Dashicons use करता है। Visually check करो — icon boxes या missing icons दिखें तो revert करो।
Fix #8 — jQuery Migrate Remove करो
jQuery Migrate एक backward compatibility script है जो पुराने jQuery code को modern jQuery के साथ काम करने देता है। 2026 में ज़्यादातर modern themes और plugins को इसकी ज़रूरत नहीं है।
// jQuery Migrate remove करो
function rs_remove_jquery_migrate( $scripts ) {
if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
$script = $scripts->registered['jquery'];
if ( $script->deps ) {
$script->deps = array_diff(
$script->deps,
array( 'jquery-migrate' )
);
}
}
}
add_action( 'wp_default_scripts', 'rs_remove_jquery_migrate' );
कब नहीं करें: पहले staging पर test करो। अगर कोई element break हो — कोई plugin old jQuery syntax use कर रहा है। उस case में revert करो।
Fix #9 — Classic Theme Styles Disable करो
WordPress 6.1 के बाद से एक "classic-theme-styles" stylesheet add हुई जो non-block themes के लिए legacy CSS provide करती है। अगर आप modern block theme use कर रहे हो — यह completely unnecessary है।
// Classic theme styles remove करो (only for block themes)
function rs_disable_classic_theme_styles() {
wp_deregister_style( 'classic-theme-styles' );
wp_dequeue_style( 'classic-theme-styles' );
}
add_action( 'wp_enqueue_scripts', 'rs_disable_classic_theme_styles' );
कब नहीं करें: अगर traditional/classic theme use कर रहे हो — यह CSS उनके लिए ज़रूरी हो सकती है।
Fix #10 — Dashboard File Editor Disable करो
यह performance fix नहीं है — pure security fix है। WordPress Admin में Appearance → Theme Editor और Plugins → Plugin Editor से directly files edit हो सकती हैं। अगर कोई attacker admin access पाए — वो directly PHP code inject कर सकता है।
// wp-config.php में add करो (WPCode में नहीं — यह core config level fix है) // "That's all, stop editing!" line से पहले add करो: define( 'DISALLOW_FILE_EDIT', true ); // अगर plugin installation भी disable करना है: define( 'DISALLOW_FILE_MODS', true ); // Note: DISALLOW_FILE_MODS = true से automatic updates भी disable होते हैं // इसलिए carefully decide करो
सब एक साथ — Master WPCode Snippet
अगर सभी safe fixes एक साथ apply करने हैं — यह single snippet WPCode में add करो:
// ===== WORDPRESS BLOAT REMOVAL — MASTER SNIPPET =====
// WPCode में PHP snippet के रूप में add करो
// Staging पर test करने के बाद live पर deploy करो
// 1. Emojis disable
add_action( 'init', function() {
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' );
add_filter( 'emoji_svg_url', '__return_false' );
});
// 2. oEmbed disable
add_action( 'init', function() {
remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
remove_action( 'wp_head', 'wp_oembed_add_host_js' );
remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );
wp_dequeue_script( 'wp-embed' );
});
// 3. XML-RPC disable
add_filter( 'xmlrpc_enabled', '__return_false' );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
// 4. Head cleanup
remove_action( 'wp_head', 'wp_generator' );
remove_action( 'wp_head', 'wp_shortlink_wp_head' );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head' );
remove_action( 'wp_head', 'rest_output_link_wp_head' );
// 5. Dashicons frontend disable (logged-out users)
add_action( 'wp_enqueue_scripts', function() {
if ( ! is_user_logged_in() ) {
wp_deregister_style( 'dashicons' );
}
}, 99 );
// 6. jQuery Migrate remove
add_action( 'wp_default_scripts', function( $scripts ) {
if ( ! is_admin() && isset( $scripts->registered['jquery'] ) ) {
$script = $scripts->registered['jquery'];
if ( $script->deps ) {
$script->deps = array_diff( $script->deps, array( 'jquery-migrate' ) );
}
}
});
// 7. Version strings from assets remove
add_filter( 'script_loader_src', function( $src ) {
global $wp_version;
parse_str( parse_url( $src, PHP_URL_QUERY ), $query );
if ( ! empty( $query['ver'] ) && $query['ver'] === $wp_version ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
});
add_filter( 'style_loader_src', function( $src ) {
global $wp_version;
parse_str( parse_url( $src, PHP_URL_QUERY ), $query );
if ( ! empty( $query['ver'] ) && $query['ver'] === $wp_version ) {
$src = remove_query_arg( 'ver', $src );
}
return $src;
});
Before और After — क्या Actually Improve होता है
| Fix | Savings | Benefit |
| Emojis disable | ~15KB + 1 HTTP request | Speed + cleaner head |
| oEmbed disable | ~10KB JS + 2 head links | Speed + security |
| XML-RPC disable | 0KB (server-side) | Major security improvement |
| Dashicons frontend disable | ~30KB CSS + font files | Speed improvement |
| jQuery Migrate disable | ~30KB JS | Speed improvement |
| Generator + version tags | Minimal size | Security — version hidden |
Combined effect: 0.3-0.8 seconds faster load time typical sites पर। यह GTmetrix और PageSpeed score दोनों में reflect होता है।
यह Bloat Removal Multisite पर कैसे Apply होता है
अगर आप WordPress Multisite use कर रहे हो — तो यह code network-wide mu-plugins folder में add करो ताकि सभी sites पर apply हो।
Multisite के लिए: wp-content/mu-plugins/ folder में एक new file बनाओ जैसे: wp-content/mu-plugins/rs-bloat-removal.php File का start होना चाहिए: <?php /** * Plugin Name: RS Bloat Removal * Description: Remove WordPress bloat network-wide */ // फिर बाकी सारा code add करो
Gutenberg और Bloat — Block Editor के Hidden Loads
अगर आप Gutenberg से layouts बना रहे हो — तो यह जानो कि Block Editor frontend पर भी कुछ CSS load करता है।
// Block Editor frontend styles disable करो
// (अगर आपकी theme already blocks को style करती है)
add_action( 'wp_enqueue_scripts', function() {
wp_dequeue_style( 'wp-block-library' ); // Core blocks CSS
wp_dequeue_style( 'wp-block-library-theme' ); // Theme blocks CSS
wp_dequeue_style( 'global-styles' ); // FSE global styles
}, 100 );
// Warning: यह करने के बाद visually check करो
// Block styles break हो सकते हैं अगर theme इन पर depend करती है
निष्कर्ष
WordPress एक assumption के साथ design हुआ है — user को maximum features चाहिए, performance optimize करना user की ज़िम्मेदारी है। यह philosophy developers के लिए frustrating है।
लेकिन good news यह है — हर unnecessary feature को safely disable किया जा सकता है। Emojis, oEmbed, XML-RPC, generator tags, Dashicons, jQuery Migrate — इन सबको हटाने के बाद आपका WordPress cleaner, faster, और ज़्यादा secure होता है।
एक rule याद रखो: हर fix को staging पर test करो पहले। और एक साथ सब मत हटाओ — एक-एक करो, effect देखो, फिर अगला।
WordPress optimization से related कोई specific सवाल है — यहाँ contact करो।
— Sanjeev Kumar | WordPress & Divi Theme Expert | sanjeevkumar.rojgarsangam.in


