If you’ve built a WordPress site using Elementor and then hand it off to a client, you’ll want to ensure they can’t do anything to hurt the overall page structure.

One of the easiest ways for a client to break a page set up in Elementor is to click the ‘Back to WordPress Editor’ button. This can revert the page to blocks and remove Elementor styling.

I’ve had this happen and had the panicked email saying that the site is broken.

There is a simple way to remove this button using a function that hides it. Just add this code during your site setup and it’ll ensure they won’t click it:

/* Disable Back to WordPress Editor button */
add_action('admin_head', 'remove_editor_button'); // admin_head is a hook my_custom_fonts is a function we are adding it to the hook

function remove_editor_button() {
  echo '<style>
    #elementor-switch-mode .elementor-switch-mode-on{
        display: none;    
    }
	body.elementor-editor-active #elementor-switch-mode-button{
	visibility: hidden;
	}
	body.elementor-editor-active #elementor-switch-mode-button:hover{
	visibility: hidden;
	}
  </style>';
}

Leave a Comment

Your email address will not be published. Required fields are marked *