Visible Edit Shortcuts, how to get rid of them?

photo found on Unsplash

Since a couple of versions already, core developers are falling over each other to enhance the Customizer. Their latest craze are the Visible Edit Shortcuts that are added to the Customizer in WordPress 4.7.

If the Customizer in itself is not irritable enough, from WP 4.7 onwards it will show an obtrusive white pencil icon in a hard blue circle to each and every editable area of your theme!

This is how that looks like for just the header of the new Twenty Seventeen theme:

Visible Edit Shortcuts

And in a post over at Make WordPress Core, you can see the full explanation including a screencast of how this can look when a theme has more than a few options.

making it easier to see which elements of your site are editable in the customizer and how to edit them

The people that decide on these new unwanted “features” must be convinced that WordPress users are stupid. Gone are the days of usability studies. Gone are the days where things would be added to Core when they would be beneficial to 80% of WordPress users. The general public already has gotten used to the idea that with each and every release, stuff no-one ever wanted, needed, or in fact even asked for, is added by a few people that invent missing features.

Does the Core team honestly expect that this will make it easier for the the average WordPress user to understand what exactly is going on there? To be honest I find it a total pain and I hardly use the Customizer in the first place!

Anyways, you came here to find out how to get rid of these “helpful shortcuts”, so shall we?

Probably the easiest way is to completely get rid of the Customizer. The plugin Customizer Remove All Parts (CRAP) does exactly that. With it, it also removes the only useful item of the Customizer: the Site Icon, so we recommend another plugin that adds the site icon to the bottom of the General Settings: Move Site Icon To Settings.

One more caveat of using a plugin that removes the entire Customizer however, is that you will not be able to use newer themes that come with Panels, such as the new Twenty Seventeen. As that certainly is not ideal either, below I give you a way to remove these Visible Edit Shortcuts via the functions.php file.

add_action( 'customize_register', 'wptips_remove_selective_refresh', 11 );

add_action( 'after_setup_theme', 'wptips_remove_selective_refresh_widgets', 11 );

function wptips_remove_selective_refresh( $wp_customize ) {

	$wp_customize->selective_refresh->remove_partial( 'blogname' );
	$wp_customize->selective_refresh->remove_partial( 'blogdescription' );
	$wp_customize->selective_refresh->remove_partial( 'custom_header' );

}

function wptips_remove_selective_refresh_widgets() {

	remove_theme_support( 'customize-selective-refresh-widgets' );

}

You see that I am adding 2 functions. The first one removes the selective refresh partials from the site title, the site description and the custom header. If you have a theme that adds a whole bunch more options to the Customizer, then this will be the function to look at to remove those again. Themes that add options to the Customizer do so mostly by using a separate file, aptly called customizer.php and in this file you will be able to find all the variables that are added.

The second function I have added is to remove the visible shortcut from the WordPress Widgets. These are added by the add_theme_support() function and can therefore be undone by using the remove_theme_support() function. Add that to the theme setup with a priority of 11 and the shortcuts for widgets will be a thing of the past.

Now the only thing I have not been able to figure out yet is how to remove the Visible Edit Shortcuts from the navigation menus. I found a post that has information on how support is added, but nothing yet on how to remove it. I will update this post if I find anything that can be used; feel free to contribute a solution in the comments!