WordPress normally provides a way to disable or turn off things you do not want that is usually easy to implement or you can always add code to your Theme functions.php file instead of installing a plugin for that. You do have a valid point though. It seems to me that WP should have a master option settings page where you can choose your own personal option setting preferences. In BPS we create Turn On and Off option settings and/or additional setting preferences because typically folks want different things/settings or do or do not want to use something.
Example: To disable emojis you can add this code in your Theme functions.php file
function disable_wp_emojicons() { // all actions related to emojis remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); // filter to remove TinyMCE emojis add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' ); } add_action( 'init', 'disable_wp_emojicons' ); function disable_emojicons_tinymce( $plugins ) { if ( is_array( $plugins ) ) { return array_diff( $plugins, array( 'wpemoji' ) ); } else { return array(); } }
Example: To disable oEmbed you can add this code in your Theme functions.php file.
Note: This code below is copied directly from the Disable Embeds plugin and the functions have been renamed to avoid a function name conflict/collision.
function disable_wp_oembeds_init() { global $wp; // Remove the embed query var. $wp->public_query_vars = array_diff( $wp->public_query_vars, array( 'embed', ) ); // Remove the REST API endpoint. remove_action( 'rest_api_init', 'wp_oembed_register_route' ); // Turn off oEmbed auto discovery. add_filter( 'embed_oembed_discover', '__return_false' ); // Don't filter oEmbed results. remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 ); // Remove oEmbed discovery links. remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); // Remove oEmbed-specific JavaScript from the front-end and back-end. remove_action( 'wp_head', 'wp_oembed_add_host_js' ); add_filter( 'tiny_mce_plugins', 'disable_wp_oembeds_tiny_mce_plugin' ); // Remove all embeds rewrite rules. add_filter( 'rewrite_rules_array', 'disable_wp_oembeds_rewrites' ); } add_action( 'init', 'disable_wp_oembeds_init', 9999 ); // Removes the 'wpembed' TinyMCE plugin. function disable_wp_oembeds_tiny_mce_plugin( $plugins ) { return array_diff( $plugins, array( 'wpembed' ) ); } // Remove all rewrite rules related to embeds. function disable_wp_oembeds_rewrites( $rules ) { foreach ( $rules as $rule => $rewrite ) { if ( false !== strpos( $rewrite, 'embed=true' ) ) { unset( $rules[ $rule ] ); } } return $rules; }
Example: To Remove the REST API link tag in page header you can add this code in your Theme functions.php file.
// Remove the REST API link tag in page header. // <link rel='https://api.w.org/' href='http://example.com/wp-json/' /> remove_action( 'wp_head', 'rest_output_link_wp_head', 10 ); remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
Example: To Remove the Link header for the WP REST API from your Headers add this code to BPS Root Custom Code:
1. Copy the code below to this BPS Root Custom Code text box: CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE
2. Click the Save Root Custom Code button.
3. Go to the Security Modes page, click the Create secure.htaccess File AutoMagic button, select the Activate Root Folder BulletProof Mode Radio button and click the Activate|Deactivate button.
# Remove the Link header for the WP REST API # [link] => <http://www.example.com/wp-json/>; rel="https://api.w.org/" <IfModule mod_headers.c> Header unset Link </IfModule>