Disable Thumbnail Image Sizes

add_filter( ‘intermediate_image_sizes_advanced’, function( $sizes ) { // Disable specific thumbnail sizes, uncomment the ones you want to disable. // unset( $sizes[‘thumbnail’] ); // 150px x 150px // unset( $sizes[‘medium’] ); // 300px x 300px // unset( $sizes[‘medium_large’] ); // 768px…Continue reading

Disable Author Archives

// Return a 404 page for author pages if accessed directly. add_action( ‘template_redirect’, function () { if ( is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } ); // Remove the author links. add_filter( ‘author_link’, ‘__return_empty_string’, 1000…Continue reading

Disable Specific Blocks

add_filter( ‘allowed_block_types_all’, function ( $allowed_block_types, $block_editor_context ) { // List here the blocks you want to disallow. https://developer.wordpress.org/block-editor/reference-guides/core-blocks/ $disallowed_blocks = array( ‘core/navigation’, ‘core/query’, ); if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) { $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); $allowed_block_types…Continue reading

Disable jQuery Migrate

add_action( ‘wp_default_scripts’, function ( $scripts ) { if ( ! is_admin() && isset( $scripts->registered[‘jquery’] ) ) { $script = $scripts->registered[‘jquery’]; if ( ! empty( $script->deps ) ) { $script->deps = array_diff( $script->deps, array( ‘jquery-migrate’ ) ); } } }, 150…Continue reading

Disable Full Site Editing (FSE)

add_action( ‘admin_menu’, function() { remove_submenu_page(‘themes.php’, ‘site-editor.php’); }); add_action(‘admin_bar_menu’, function($wp_admin_bar) { $wp_admin_bar->remove_node(‘site-editor’); }, 250); add_action(‘admin_init’, function() { global $pagenow; if (‘site-editor.php’ === $pagenow) { wp_safe_redirect(admin_url()); exit; } });Continue reading