Brutkey

Terence Eden’s Blog
@blog@shkspr.mobi

A big list of things I disable in WordPress


https://shkspr.mobi/blog/2025/11/a-big-list-of-things-i-disable-in-wordpress/



There are many things I like about the WordPress blogging software, and many things I find irritating. The most annoying aspect is that WordPress insists that its way is the best and there shall be no deviance. That means a
lot of forced cruft being injected into my site. Headers that bloat my page size, Gutenberg stuff I've no use for, and ridiculous editorial decisions.

To double-down on the annoyance, there's no simple way to turn them off. In part, that is due to the "
WordPress Philosophy":

Decisions, not options[…] Every time you give a user an option, you are asking them to make a decision. When a user doesn’t care or understand the option this ultimately leads to frustration.
I broadly agree with that. Having hundreds of options is a burden for users and a nightmare for maintainers. Do please read this excellent discussion from Tom McFarlin for a more detailed analysis.

But I
want to turn things off. Luckily, there is a way. If you're a developer, you can remove a fair number of these "enforced" decisions. Add the following to your theme's functions.php file and watch the mandatory WordPress bloat whither away. I've commented each removal and, where possible, given a source for more information. Feel free to leave a comment suggesting how this script can be improved and simplified. PHP`// Remove mandatory classic theme.function disable_classic_theme_styles() {
wp_deregister_style( "classic-theme-styles" );
wp_dequeue_style( "classic-theme-styles" );
}
add_action( "wp_enqueue_scripts", "disable_classic_theme_styles" );

// Remove WP Emoji.//
http://www.denisbouquet.com/remove-wordpress-emoji-code/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" );
//
https://wordpress.org/support/topic/remove-the-new-dns-prefetch-code/add_filter( "emoji_svg_url", "_returnfalse" );

// Stop emoji replacement with images in RSS / Atom Feeds//
https://danq.me/2023/09/04/wordpress-stop-emoji-images/remove_filter( "the_content_feed", "wp_staticize_emoji" );
remove_filter( "comment_text_rss", "wp_staticize_emoji" );

// Remove automatic formatting.//
https://css-tricks.com/snippets/wordpress/disable-automatic-formatting/remove_filter( "the_content", "wptexturize" );
remove_filter( "the_excerpt", "wptexturize" );
remove_filter( "comment_text", "wptexturize" );
remove_filter( "the_title", "wptexturize" );

// More formatting crap.add_action("init", function() {
remove_filter( "the_content", "convert_smilies", 20 );
foreach ( array( "the_content", "the_title", "wp_title", "document_title" ) as $filter ) {
remove_filter( $filter, "capital_P_dangit", 11 );
}
remove_filter( "comment_text", "capital_P_dangit", 31 ); // No idea why this is separate
remove_filter( "the_content", "do_blocks", 9 );
}, 11);

// Remove Gutenberg Styles.//
https://wordpress.org/support/topic/how-to-disable-inline-styling-style-idglobal-styles-inline-css/remove_action( "wp_enqueue_scripts", "wp_enqueue_global_styles" );

// Remove Gutenberg editing widgets.// From
https://wordpress.org/plugins/classic-widgets/// Disables the block editor from managing widgets in the Gutenberg plugin.add_filter( "gutenberg_use_widgets_block_editor", "_returnfalse" );
// Disables the block editor from managing widgets.add_filter( "use_widgets_block_editor", "_
returnfalse" );

// Remove Gutenberg Block Library CSS from loading on the frontend.//
https://smartwp.com/remove-gutenberg-css/function remove_wp_block_library_css() {
wp_dequeue_style( "wp-block-library" );
wp_dequeue_style( "wp-block-library-theme" );
wp_dequeue_style( "wp-components" );
}
add_action( "wp_enqueue_scripts", "remove_wp_block_library_css", 100 );

// Remove hovercards on comment links in admin area.//
https://wordpress.org/support/topic/how-to-disable-mshots-service/#post-12946617add_filter( "akismet_enable_mshots", "_returnfalse" );

// Remove Unused Plugin code.function remove_plugin_css_js() {
wp_dequeue_style( "image-sizes" );
}
add_action( "wp_enqueue_scripts", "remove_plugin_css_js", 100 );

// Remove WordPress forced image size//
https://core.trac.wordpress.org/ticket/62413#comment:40add_filter( "wp_img_tag_add_auto_sizes", "_returnfalse" );

// Remove <img> enhancements//
https://developer.wordpress.org/reference/functions/wp_filter_content_tags/remove_filter( "the_content", "wp_filter_content_tags", 12 );

// Stop rewriting http:// URls for the main domain.//
https://developer.wordpress.org/reference/hooks/wp_should_replace_insecure_home_url/remove_filter( "the_content", "wp_replace_insecure_home_url", 10 );

// Remove the attachment stuff//
https://developer.wordpress.org/news/2024/01/building-dynamic-block-based-attachment-templates-in-themes/remove_filter( "the_content", "prepend_attachment" );

// Remove the block filterremove_filter( "the_content", "apply_block_hooks_to_content_from_post_object", 8 );

// Remove browser check from Admin dashboard.//
https://core.trac.wordpress.org/attachment/ticket/27626/disable-wp-check-browser-version.0.2.phpif ( !empty( $_SERVER["HTTP_USER_AGENT"] ) ) {
add_filter( "pre_site_transient_browser_" . md5( $_SERVER["HTTP_USER_AGENT"] ), "_
returnnull" );
}

// Remove shortlink.//
https://stackoverflow.com/questions/42444063/disable-wordpress-short-linksremove_action( "wp_head", "wp_shortlink_wp_head" );

// Remove RSD.//
https://wpengineer.com/1438/wordpress-header/remove_action( "wp_head", "rsd_link" );

// Remove extra feed links.//
https://developer.wordpress.org/reference/functions/feed_links/add_filter( "feed_links_show_comments_feed", "_returnfalse" );
add_filter( "feed_links_show_posts_feed", "_
returnfalse" );

// Remove api.w.org link.//
https://wordpress.stackexchange.com/questions/211467/remove-json-api-links-in-header-htmlremove_action( "wp_head", "rest_output_link_wp_head" );
//
https://wordpress.stackexchange.com/questions/211817/how-to-remove-rest-api-link-in-http-headers// https://developer.wordpress.org/reference/functions/rest_output_link_header/remove_action( "template_redirect", "rest_output_link_header", 11, 0 );
`

You can find the latest version of
my debloat script in my theme's repo.

If there are other things you find helpful to remove, or a better way to organise this file, please drop a comment in the box.

#blog #HowTo #php #WordPress